我添加的屬性「項的具有admin.I輸入類型文本要顯示在購物cart.For該屬性,我已經在template/checkout/cart/sidebar-top.phtml
其中加入此代碼的值低於:如何在購物車中顯示屬性的值?
<?php
$productId = $_item->getId();
$productInfo = Mage::getModel("catalog/product")->load($productId);
echo $productInfo->getAttributeText('product_type');
?>
但當我添加上面的代碼顯示
Fatal error: Call to a member function getId() on a non-object
如果有人知道這一點,請幫我out.thanks!
我加入這個代碼,然後顯示錯誤 致命錯誤:調用一個成員函數getProduct()一個非對象 –
你可以檢出$ _item-> getCount將(); – MagentoDiary