I can't update subtotal item in cart. I created module with observe checkout_cart_product_add_after I can get subtotal price from item:
$subtotal = Mage::getSingleton('checkout/cart')->getQuote()->getSubtotal();
but I can't update this, for exmaple:
$subtotal = $subtotal + 100;
Mage::getSingleton('checkout/session')->getQuote()->setSubtotal($subtotal);
Mage::getSingleton('checkout/cart')->getQuote()->setSubtotal($subtotal);
Mage::getSingleton('checkout/session')->getQuote()->save();
Mage::getSingleton('checkout/cart')->getQuote()->save();
EDIT
If I run in my Observer print_r($subtotal); exit;
I get correct updated subtotal. In cart page I have still orginal subtotal without change.
EDIT 2 I'm trying run modifySubtotal function with sales_quote_collect_totals_after event, but I can't see on cart page updated subtotal price. Below code of modifySubtotal from Observer.php:
public function modifySubtotal(Varien_Event_Observer $observer)
{
$session = Mage::getSingleton('checkout/session');
$quote=$observer->getQuote();
$subtotal = $quote->getBaseSubtotal();
$subtotal = $subtotal +123;
$quote->setBaseSubtotal($subtotal);
$quote->save();
$subtotal2 = $quote->getBaseSubtotal();
//print_r($subtotal2);exit;
}
I'll be grateful for any tips and help.