Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Condition to Show Attribute Question
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

Hi,

I have an attribute that at the moment is conditionally displayed when there is data in the field. Ive added a date field also, but i cant figure out how to make it also part of the condition

For example
IF attribuite_value not null and attribute_held_till <= today then show

Here is my code to only show when there is a value.

<?php if ($_product->getData('z_government_rebate_to')): ?>
                    
<h6 class="link-product-list-leadtime" >Rebate Available<?php echo nl2br($_product->getData('z_government_rebate_to')) ?></h6>
<?php endif; ?>

thanks
Brendan

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