0
votes

I have an observer for the event

controller_action_predispatch_checkout_onepage_savePayment

and I want to change the Grand Total based on some conditions. I tried with:

$value = 100;

$quote = Mage::getSingleton('checkout/type_onepage')->getQuote();

$quote->setGrandTotal($value);

$quote->setTotalsCollectedFlag(false)->collectTotals();

$quote->save();

or

$value = 100;

$quote = Mage::getSingleton('checkout/type_onepage')->getQuote();

$quote->setGrandTotal($value);

$quote->collectTotals();

$quote->save();

But it don't works. Any ideas?

Thanks to all!

1
set both grandtotal and basegrandtotal, magento not accept if you set only grandtotalMufaddal

1 Answers

0
votes

The problem was:

After the event controller_action_predispatch_checkout_onepage_savePayment there's another event who update from zero the grand total, so my changes vanish!