在结帐页面中显示产品属性不在magento中工作

时间:2015-03-30 07:26:12

标签: php magento attributes checkout

我添加了一个属性形状。

attribute code -> shape
attribute label -> Shape
values -> diamond, square, round
input type -> multi select

现在我想在结帐页面中显示属性形状详细信息。我在app\design\frontend\mytheme\mytheme\template\checkout\cart\item\default.phtml

中尝试了以下代码

我的代码如下:

echo $_item->getShape();

很遗憾没有显示任何内容。我怎样才能做到这一点。任何帮助将不胜感激!!

1 个答案:

答案 0 :(得分:3)

问题是你试图从模型Mage_Sales_Model_Quote_Item获取Shape。不幸的是,它并没有这样做。

请尝试此解决方案:

$product = Mage::getSingleton('catalog/product')->load($_item->getProduct()->getId());
echo $product->getShape();