Royer Royer - 6 months ago 56
HTML Question

How to display custom attribute in cart (Magento)

I have tried a lot of stuf but none of them work. I think I can get the custom attributes on the product page, but I was wondering: how to get them in shopping cart page? (the attribute is just a simple written text)

Thank you.


Are you talking about custom option or simple attribute?

Simple attribute (text):
(In your default.phtml)

<?php $_item = $this->getItem()?>
<?php $_product= Mage::getSingleton('catalog/product')->load($_item->getProductId()) ?>
<?php echo $_product->getResource()->getAttribute('attribute_code')->getFrontend()->getValue($_product); ?>