I'm currently working on a Magento extension where I need help in getting the total price of all products having the same attribute when they are added to the cart.
Here is my code for a better explanation @ the shipping's carrier page:
foreach ($this->_quote->getAllItems() as $item) {
$productid = $item->getProductId();
$product = Mage::getModel('catalog/product')->load($productid);
$chilledFood = $product->getData('is_chilled_food'); // the custom attribute 'is_chilled' added to product backend, so if the product is chilled, the value will be 'yes'
if ($chilledFood) { // need help from here?
return $this->_price = ' ';
}
}
So I need help on knowing if the customer selects chilled food in the cart. If yes, the shipping price will be an additional $5 from other types of food category. BUT there will be free shipping cost if the total chilled food amounts to $50 and above.
Thank you.