Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4171078
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:24:24+00:00 2026-05-21T00:24:24+00:00

Surprisingly can’t find anything on this… basically I call my custom product attributes on

  • 0

Surprisingly can’t find anything on this… basically I call my custom product attributes on the product view page like this:

Men / Women: <?php echo $this->htmlEscape($_product->getmenwomen()) ?>

This displays the men/women attribute fine, but these are optional values, so if a product doesn’t have a value for this particular attribute, the line is still displayed, just with no value:

Men / Women:

I’d like that line to not show at all if there is indeed, no value for a product. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T00:24:24+00:00Added an answer on May 21, 2026 at 12:24 am

    You have to check if the value of getmenwomen() really contains something you expect it to contain (eg men/women) before printing it. In this example i presume that anything but whitespace is a valid value.

    $menwomen = $_product->getmenwomen();
    if (trim($menwomen)) {
        echo "Men / Women: ".$this->htmlEscape($menwomen);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked everywhere and surprisingly can't find a good solution to this! I've
Surprisingly I was only able to find one previous question on SO about this
Very simple question (surprisingly I can't find a similar question anywhere): how do I
Surprisingly enough I couldn't find the answer to this question. I am trying to
I have a list of items that can be represented like this: ClientNo Name
I searched for this here and on google and surprisingly couldn't find an answer.
Surprisingly can't find a match for my question. I have one table that I
I figured this must be a common question, but I surprisingly couldn't find an
I can find tons of general purpose documentation on Boost.Build, but surprisingly nothing on
I'm trying to learn Hive. Surprisingly, I can't find an example of how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.