检查 magento 中的属性值 [英] Check the value of an attribute in magento

查看:19
本文介绍了检查 magento 中的属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义属性是/否,我想做的是在我的 magento 网站的产品详细信息页面上根据该属性的值为是或否显示或隐藏图像

I have a custom attribute yes/no and what i want to do is on the product detail page of my magento site show or hide an image based on wether the value of this attribute is yes or no

我的自定义属性是 is_real_wood

my custom attribute is is_real_wood

推荐答案

如果你的属性被调用,比如说,show_image,那么你可以这样读:

If your attribute was called, say, show_image then you read it back like this:

<?php if ($_product->getShowImage()) : ?>
    <img .... /><!-- PUT WHATEVER ELSE HTML YOU NEED HERE -->
<?php endif; ?>

这篇关于检查 magento 中的属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆