I have 2 modules installed on my Australian based Magento store and they both affect the quote calculations when items are being added to the cart. It appears as though one module is conflicting with the other and my attempts to get help with the module creators has provided little to none support.
The modules are the following:
aheadWorks - Points and Rewards Module
MageWorld - Free Gift Module
When both these modules are active, I have Grand Total calculation errors, specifically, the tax is not being added to the Grand Total as it should be. Australian legislation states that a products price needs to include tax (which is a flat rate of 10% for all goods) and the Grand Total also needs to include the tax paid, in addition, the invoice needs to show the amount paid in tax to the customer.
Now, when I disable the MW – Free Gift Module, the calculation appears to function correctly, which leads me to believe that the fault can be fixed by modifying that module. After looking through and testing parts of the config.xml files in both modules I have found that they both contain additions to the global > sales > quote > totals
nodes:
aheadWorks - Points and Rewards Module > etc\config.xml
<global>
…
<sales>
<quote>
<totals>
<points>
<class>points/total_quote_points</class>
<after>wee,discount,tax,tax_subtotal,grand_total</after>
<renderer>points/checkout_total</renderer>
</points>
</totals>
</quote>
...
</sales>
</global>
MageWorld - Free Gift Module > etc\config.xml
<global>
...
<sales>
<quote>
<totals>
<freegift>
<class>freegift/quote_address_total_freegift</class>
<after>subtotal</after>
<before>tax_subtotal,shipping</before>
</freegift>
</totals>
</quote>
</sales>
</global>
Unfortantley, this code eludes me on some levels as to how it works. I understand that the class node refers to a certain model in each respective module, and that the model refered to in the class node, is called by some other model when calculating the totals for the quote. I don't know which model is responsible for calling these other models to do the quote calculations. What I have found is that commenting out the code that I have shown above in the MageWorld module only, appears to fix the problem, I can't imagine what other problems it introduces.
I am assuming that the <after>
and <before>
nodes affect the order in which these calculations are made, but I can't seem to figure out how it works. Can anyone give advice on how this works and some suggestions on how I can debug this issue, as currently my stores invoices are not appearing correctly.