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

How can I display a text/image if attribute value is YES. 
 
thebullet
Jr. Member
 
Total Posts:  23
Joined:  2008-10-16
 

I have a YES/NO attribute and I want to display next to Add To Cart button a text and an image if the value of this attrubute is YES.

How can I do this?

Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
thebullet
Jr. Member
 
Total Posts:  23
Joined:  2008-10-16
 

???????????

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale1
Guru
 
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

hi,

<?php if($_product->getMyAttribute()): ?>
<img src="/path/to/the/image.jpg">
<?php endif; ?>

cheers

stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
thebullet
Jr. Member
 
Total Posts:  23
Joined:  2008-10-16
 

Thans Stefan for your reply,
I have a doubt:
for example if my attribute is xxxxxxx, i need to create an specific function getxxxxxxx() ? where?
how can I pass the attribute name?

Thanks again

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