I really don't know if this will help in any way, but something to look into.
It is possible that your collecttotals
model order is ordering differently, and that tax is being ordered/applied after grand_total
You can test if this is the issue as follows. (note this involves adjusting a core file to get some debug info, please do not try this on a live site!)
Edit the method located in:
Mage_Sales_Model_Quote_Address::collecttotals
and add one line to the method, which will allow you to output the models as they are processed.
public function collectTotals()
{
Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_before', array($this->_eventObject => $this));
foreach ($this->getTotalCollector()->getCollectors() as $model) {
mage::log($model->getCode()); // <===== ADD THIS LINE
$model->collect($this);
}
Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_after', array($this->_eventObject => $this));
return $this;
}
ensure logging is enabled.
tail the log file via the console: tail -f system.log
Reproduce the issue via the frontend.
You will get entries as follows in your log (this from a vanilla 1.9.2.2 - you may have other entries)
2015-12-21T05:54:12+00:00 DEBUG (7): nominal
2015-12-21T05:54:12+00:00 DEBUG (7): subtotal
2015-12-21T05:54:12+00:00 DEBUG (7): msrp
2015-12-21T05:54:12+00:00 DEBUG (7): freeshipping
2015-12-21T05:54:12+00:00 DEBUG (7): tax_subtotal
2015-12-21T05:54:12+00:00 DEBUG (7): weee
2015-12-21T05:54:12+00:00 DEBUG (7): shipping
2015-12-21T05:54:12+00:00 DEBUG (7): tax_shipping
2015-12-21T05:54:12+00:00 DEBUG (7): discount
2015-12-21T05:54:12+00:00 DEBUG (7): tax
2015-12-21T05:54:12+00:00 DEBUG (7): grand_total
You will see it repeat, so just see where it starts, and ends, should be easy to see the pattern
Note the last two entries above: Tax comes before grand_total.
It may be possible this ordering is out of whack, and tax is appearing after grand_total, so grand_total will not have taxes applied.
EDIT:
Ok, so I did not see the referred question actually points to the sorting of the collectotals to be the issue. I suspected that may be the issue, but have not tested this myself in PHP7
There is a solution, but it is not a very nice. Any new extension placed in the store, which inserts models into the collector, would need to be noted, and additionally added to the sorting, else things could go even more wrong. Can be a bit of a maintenance issue going forward.
Simply force the sort order by placing a specific <sort_order>
into the totals configuration. You can do this via your own extension, which would only have a config.xml, where you specify the order for each collector.
in the config.xml, have directive as such:
<sales>
<quote>
<totals>
<nominal>
<sort_order>100</sort_order>
</nominal>
<subtotal>
<sort_order>200</sort_order>
</subtotal>
<msrp>
<sort_order>300</sort_order>
</msrp>
<freeshipping>
<sort_order>400</sort_order>
</freeshipping>
......
insert each collector model with a sort directive
......
</totals>
</quote>
Use large gaps between each sorting directive, to allow space to insert additional going forward.
As mentioned, not very elegant, but can solve your immediate problem.
Also note that there are other collector directives in the system, so they may also be wrong/needing adjustment
Check the core sales extension config.xml, and seach for <totals>
There you will find:
<order_invoice>
<order_creditmemo>
<pdf>
There may be others in other extensions, be it core/3rd party
Hope that helps.
PS: I have not tested any of this in PHP7. I know the placing of the sort_order directive works under php5.x