I want to add a "custom Price" which have been generated on the Product-Site to the product Price on the cart.

With the actual code it is only the value (price) of the hidden field which is delivered to the cart - without the product price.

Code with checkout_cart_product_add_after:

public function change_price(Varient_Event_Observer $observer) {

    $item = $observer->getQuoteItem();

    if ($item->getParentItem()) {
        $item = $item->getParentItem();

    $newpricetest = Mage::app()->getRequest()->getPost('priceInput');

    $new_price = $item->getOriginalPrice() + $newpricetest;



What's wrong?

  • Check with some logging in method to see upto which point it is working. This should be as simple as Mage::log('123'); in various places and different values. Make sure you have logging enabled from admin.
    – Prateek
    Mar 11, 2016 at 13:52
  • that will work seems ur module is not working i had done same before also
    – mcoder
    Mar 11, 2016 at 17:39

2 Answers 2


Using sales_quote_add_item event observer is working for me.




class MyCompany_MyModule_Model_Observer
    public function updateCartPrice(Varien_Event_Observer $observer)
        $event = $observer->getEvent();        
        $quoteItem = $event->getQuoteItem();
        //$product = $item->getProduct();        

        $customPrice = YOUR_CUSTOM_PRICE;

Better to use catalog_product_get_final_price observer and set the custom price before adding to the cart would be an easy win. Using add after requires manual collect totals and save.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.