上午顯示所有產品到首頁,其工作正常。但其顯示產品價格,圖像只現在想顯示產品說明也在主頁如何顯示產品說明在家頁?如何在magento主頁顯示產品描述
<?php $_description = $_product->getProduct()->getDescription(); ?>
不工作上面的代碼,我把,
app/design/frontend/rwd/default/temaplate/catalog/product/list.phtml
上午顯示所有產品到首頁,其工作正常。但其顯示產品價格,圖像只現在想顯示產品說明也在主頁如何顯示產品說明在家頁?如何在magento主頁顯示產品描述
<?php $_description = $_product->getProduct()->getDescription(); ?>
不工作上面的代碼,我把,
app/design/frontend/rwd/default/temaplate/catalog/product/list.phtml
這應該給你的產品的描述
$_product->getData('short_description')
或
$_product->getShortDescription()
感謝它的工作。 –
hi plz explain getChildHtml();意味着它將如何工作? –
我建議你通過一些帖子,像這一個http://stackoverflow.com/questions/19488885/understanding-getchildhtml-in-magento –
$_product
是實例所以如果你想要的產品描述,你應該撥打電話$_product->getDescription()
而不是$_product->getProduct()->getDescription()
如果你沒有看到一個錯誤消息,你應該檢查你的開發環境設置正確。如果您看到錯誤消息,請將其添加到問題中。另外,當你的代碼「不工作」時,你應該寫下你期望的代碼做什麼以及做什麼,以便更清楚地知道什麼「不工作」對你意味着什麼。 – hakre