Event change price in cart Magento


In Magento, event been used a lot. Event in Magento is very strong.

If you want change price in cart of Magento, but not is add product to cart. Simple, let’s using event..

Following, I will create demo a event:

  • Initialization event in config.xml
  • Using event name: sales_quote_add_item
  • Using function: updateProductCartPrice



In Observers.php file. My url: app/code/local/Test/Addcart/Model/Observers.php

Create a function updateProductCartPrice have content:

  • priceChange: new price



Ok. So, price will change in cart after load again page.




About Author

Là một developer rất ham chơi nhưng không ham hố, không ham chơi nhưng rất thích cầm đầu...

Comments are closed.

%d bloggers like this: