I'm using checkout_cart_product_add_after event.
I have requirement like this Tier Prices for Specific Increments
I have written following code in my observer.
But row total is not updated in cart page.But in system.log its giving updated value.Thanks in advance.please let me know if you need any clarification.
Here Specific increment=3;
class Exinent_Customprice_Model_Observer {
public function customprice(Varien_Event_Observer $observer){
$item = $observer->getQuoteItem();
if ($item->getParentItem()) {
$item = $item->getParentItem();
}
if (($item->getQty() % 3) == 0)
{
$custom_price=5;
$item->setCustomPrice($custom_price);
$item->setOriginalCustomPrice($custom_price);
$item->getProduct()->setIsSuperMode(true);
}
else
{
$custom_price=5;
$rem=(int)(($item->getQty())/3);
$rowsubtotal=($rem)*(3)*($custom_price)+($item->getQty() % 3)*($item->getProduct()->getPrice());
Mage::log($rowsubtotal);
$item->setRowTotal($rowsubtotal);
Mage::log($item->getRowTotal());
}
}
}