2010-06-24 131 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];