Magento Forum

   
custom attribute on product view
 
jonasjames
Jr. Member
 
Total Posts:  29
Joined:  2012-01-23
 

I use the code <b>Manufacturer</b>: <?php echo $_product->getAttributeText('manufacturer'); ?><br /> to display the product manufacturer but I would like it to only display this line if the manufacturer attribute is not blank how do i go about doing this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jonasjames
Jr. Member
 
Total Posts:  29
Joined:  2012-01-23
 

seems like <?php if($_product->getCondition()):?> <b>Condition</b>: <?php echo $_product->getAttributeText('condition'); ?> <?php endif; ?> does the trick if anyone was interested smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

Use this:

<?php if ($_product->getManufacturer()) : ?>
    
<b>Manufacturer</b>: <?php echo $_product->getAttributeText('manufacturer'); ?><br />
<?php endif;?>

Marius.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top