Magento 展示产品&x27;将自定义属性添加到主页或静态页面
我想Magento 展示产品&x27;将自定义属性添加到主页或静态页面,magento,custom-attributes,Magento,Custom Attributes,我想echo自定义属性到任何其他页面,除了产品页面或类别列表在几乎任何页面中获取自定义属性的一种方法可以如下所示(在PHP中): 可以更具体一点我创建了一个名为power的新属性,我想在首页特色产品滑块上显示它。 $product_id = $this->getProduct()->getId(); // note that this changes depending on how you load your product $storeId = Mage::app()->g
echo
自定义属性到任何其他页面,除了产品页面
或类别列表
在几乎任何页面中获取自定义属性的一种方法可以如下所示(在PHP中):
可以更具体一点我创建了一个名为
power
的新属性,我想在首页特色产品
滑块上显示它。
$product_id = $this->getProduct()->getId(); // note that this changes depending on how you load your product
$storeId = Mage::app()->getStore()->getStoreId();
$value = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id, 'your_power_attribute_id', $storeId);
echo $value;