Here is the modules config file: app\etc\modules\Cart_Updates.xml

<?xml version="1.0" encoding="UTF-8"?>

Here is my config file : in app\code\local\Cart\Updates\etc\config.xml

<?xml version="1.0"?>

And here is the Observer: in app\code\local\Cart\Updates\Model\Observer.php


    class Cart_Updates_Model_Observer {

      public function modifyPrice(Varien_Event_Observer $observer) {
      $order = Mage::registry('current_order'); //For getting current order 
      echo $orderid = $order->getRealOrderId(); // For getting orderid
      $quote_item = $observer->getQuoteItem();
      $payment = 30; //add your custom product price here and do your logic here
      return $this;
  • Do you want to update your cart item price on cart update? Mar 9 '17 at 12:10
  • i want to set the custom price when product will be added to the cart, it will show custom price that we will set in the observer and over ride the original one
    – Zoo
    Mar 9 '17 at 12:12

here is code for updting the custom price

use this event checkout_cart_product_add_after

for current event


other method

   $product_id = $item->getProductId();
   $item= Mage::getModel('sales/quote_item')->load($item->getId());
   $payment = 30;
  • Not working bro.
    – Zoo
    Mar 9 '17 at 12:14
  • i think it is not triggering the Observer. i have added die; top of the function its not doing any thing.
    – Zoo
    Mar 9 '17 at 12:16
  • use checkout_cart_product_add_after event Mar 9 '17 at 12:18
  • It is not working for me Bro..
    – Xabby
    Mar 9 '17 at 15:41
  • @Xabby change method name to updatePrice as you declare in config.xml Mar 9 '17 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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