There are a few threads on here explaining how to get a product attribute in the cart or checkout. However, I just can't get it to work.
In the cart I can see the product attribute, but not in the checkout.
From what I've read, the checkout doesnt know about the product, so I need to load it. This would explain why Im not seeing it.
I've tried a lot of things, but I either don't get my shipping step to load in the cart, or it just doesn't display.
Any help would be great! Here is my code in a custom shipping module.
$cart = Mage::getSingleton('checkout/session');
//Order value by category
$gold = 0;
foreach ($cart->getQuote()->getAllItems() as $item) {
$itemPrice = $item->getPrice();
$qty = $item->getQty();
$metalType = Mage::getModel('catalog/product')->load($item->getProduct()->getId())->getAttributeText('metal');
if ($metalType == "Gold") {
//Apply some business logic
$gold = $itemPrice * $qty;
}
}
->getMetal()
? – scrowler