This question already has an answer here:
When Adding a product to cart programatically ,the price of the product becomes zero ($0.00) on the fist time , but on adding the same item to the cart, it shows the price .
The product adding is handled by Event observer method on the event "checkout_cart_add_product_complete" using the below code.
$cart = Mage::getModel('checkout/cart'); $cart->init(); $product_id=1387; $product = Mage::getModel('catalog/product')->load($product_id); $params = array( 'product' => $product_id, 'qty' =>1 ); $cart->addProduct($product,$params); $cart->save(); Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
Please help me to solve this problem.
But when i go to cart and return to the product page the price shown or when i delete a product in the cart the price shown.