2010-06-24 130 views

回答

6

确保属性被标记为“在前端使用”,然后在模板名称写出下面要看到的属性:

<?php print $_product->getBrandInfo(); ?> 
+0

这个工作,但它需要_product $,而不是$产品 – a1anm 2010-06-27 15:24:31

10

要显示属性的产品页面上的内容您需要在view.phtml文件中添加以下代码。

$_product->getResource()->getAttribute('brand_info')->getFrontend()->getValue($_product); 
5

下面的代码添加到您的catalog/product/view.phtmlcatalog/product/list.html模板文件:

echo $_product->getAttributeText('your_attribute_code'); 

只要改变了your_attribute_code你的属性代码,你就大功告成了。

1

我发现,增加view.phtml是最适合我

print $_product[brand_info];