1

I want to set a custom row total. I am using 'checkout_cart_product_add_after' event. And want to update Row total. I going to add an extra amount in an item row total. like,

$item->setRowTotal($item->getRowTotal + 100);
$item->save();
0

checkout_cart_product_add_after is triggered after the quote has already been saved.

Try sales_quote_product_add_after

The event has one parameter, items with an array of quote items that have been generated from this product. For simple products it is always one item. For complex products (bundle, configurable), the first array item is always the parent (i.e. the main product). So you get your item like this:

$item = $observer->getItems()[0];
  • Not working..... – Ravi Soni Apr 29 at 12:55
  • @RaviSoni, any luck ? – Amatya Trivedi Aug 7 at 11:16
  • Yes, We have set our custom price divided by qty in Add action and then set that price in the registry. Then in the observer, we get that registry and then set a custom price logic. But yes, still we get point difference in price. – Ravi Soni Aug 7 at 12:16

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.