I've been struggling with the same issue for the past weeks. The only way I got it working is through this rather nasty hack. I really hope someone will find a cleaner solution, but for now, it works.
Basically I do a recalculation just before the template is rendered. I created a copy of review.phtml
: app/design/frontend/custom/view/template/checkout/onepage/review.phtml
and added a method call at the top of the template:
<?php
$this->reCalculateTotals();
?>
Then I created a copy of Review.php
:
app/code/local/Mage/Checkout/Block/Onepage/Review.php
and added the public method:
public function reCalculateTotals() {
$this->getQuote()->collectTotals(true)->save();
}
Pay close attention to the parameter true
I pass to collectTotals
:
A copy of Quote.php
goes to app/code/local/Mage/Sales/Model/Quote.php
and at around line 1280
I change the signature of collectTotals
to:
/**
* Collect totals
*
* @param bool $force Should we ignore getTotalsCollectedFlag
*
* @return Mage_Sales_Model_Quote
*/
public function collectTotals($force = false)
and change the if statement to ignore a return when forced to recalculate"
/**
* Protect double totals collection
*/
if (!$force && $this->getTotalsCollectedFlag()) {
return $this;
}
This should do the trick (as long as you have your shipping method already saved). If not, let me know and I'll add more info on how I saved the shipping method (this might be a bit tricky since I use Carriers and not table rates).