小编use*_*779的帖子

如何检查产品属性集中是否存在属性?Magento的

如何检查产品属性集中是否存在属性?

我需要知道产品是否具有其属性集的属性.

我得到的属性:

$attrPricekg = Mage::getModel('catalog/product')->load($_product->getId())->getPricekg();
Run Code Online (Sandbox Code Playgroud)

如果产品属性集中存在属性,则$ attrPricekg显示:产品的设置值,如果没有为产品设置值,则为0.

如果产品属性集中不存在该属性,则$ attrPricekg显示0.这是我的问题..我需要避免这种情况,我想检查该产品的属性是否存在.

谢谢.

attributes product catalog magento

7
推荐指数
3
解决办法
2万
查看次数

标签 统计

attributes ×1

catalog ×1

magento ×1

product ×1