【发布时间】:2019-10-27 21:33:21
【问题描述】:
我创建了自定义属性值来连接产品视图上的外部链接显示。我的自定义属性作为连接到我的公共市场商店(如 lazada)的按钮。问题是当后端没有值时如何隐藏属性。
属性值“shoopee”是我的代码
<button type="button" onclick="window.open('','_new').location.href = '<?php echo $_helper->productAttribute($_product, $_product->getshopee(), 'shopee') ?>'; return false;" class="button" role="button"><span><span><?php echo $this->__('beli shopee') ?></span></span></button>
当属性值为空时,我想隐藏按钮。
【问题讨论】:
-
把按钮放到PHP里面,就是不回显,productAttribute什么都不返回,问题出在哪里?
-
顺便说一句:我不知道你的 $_helper 返回什么,是 FALSE 还是空的,当后端没有价值时?
标签: php html magento attributes magento-1.9