【发布时间】:2015-04-09 10:29:07
【问题描述】:
我想将 echo 自定义属性添加到任何其他页面,Product Page 或 Category Listing 除外
【问题讨论】:
-
可以更具体一点
-
我创建了一个名为
power的new attribute,我想在主页上显示它featured product滑块。
我想将 echo 自定义属性添加到任何其他页面,Product Page 或 Category Listing 除外
【问题讨论】:
power 的new attribute,我想在主页上显示它featured product 滑块。
在几乎任何页面中获取自定义属性的一种方法可以如下完成(在 PHP 中):
$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;
【讨论】: