I was trying to define some exceptions, and one of them is about the volume of the product. I've got width-length-height attributes in the products. And i was trying to get the total of these 3 attributes of all the products at my cart.
So i was trying things like this:
$cart = Mage::getModel('checkout/cart')->getQuote();
$totalV= 0;
foreach ($cart->getAllItems() as $item) {
$prod_W = $item->getAttributeText('dp_width');
$prod_H = $item->getAttributeText('dp_height');
$prod_L = $item->getAttributeText('dp_length');
$totalV += $prod_H + $prod_L +$prod_W;
}
?>
<input type = "hidden" class = "onestepcheckout-vol-prod" value = "<?php echo $totalV;?>
" >
</input>
I tries to using $item->getProduct()->getAttributeText('X');
but it gives me an error.
How could i get these values ?