1

I have two same extension but both are using for a different-different purpose.

Extension A Config.xml

<config>
<modules>
    <Mageworks_Fee>
        <version>0.1.5</version>
    </Mageworks_Fee>
</modules>
<global>
    <sales>
        <quote>
            <totals>
                <fee>
                    <class>fee/sales_quote_address_total_fee</class>
                    <renderer>fee/checkout_totals_fee</renderer>
                    <admin_renderer>fee/adminhtml_sales_order_create_totals_fee</admin_renderer>
                </fee>
            </totals>
        </quote>
        <order_invoice>
            <totals>
                <fee>
                    <class>fee/sales_order_total_invoice_fee</class>
                </fee>
            </totals>
        </order_invoice>
        <order_creditmemo>
            <totals>
                <fee>
                    <class>fee/sales_order_total_creditmemo_fee</class>
                </fee>
            </totals>
        </order_creditmemo>
    </sales>
   </global>
 </config> 

Extension B Config.xml

 <config>
<modules>
    <Mageworks_Insurance>
        <version>0.1.5</version>
    </Mageworks_Insurance>
</modules>
<global>
    <sales>
        <quote>
            <totals>
                <insurance>
                    <class>insurance/sales_quote_address_total_insurance</class>
        <before>fee</before>
                    <renderer>insurance/checkout_totals_insurance</renderer>
                    <admin_renderer>insurance/adminhtml_sales_order_create_totals_insurance</admin_renderer>
                </insurance>
            </totals>
        </quote>
        <order_invoice>
            <totals>
                <insurance>
                    <class>insurance/sales_order_total_invoice_insurance</class>
                </insurance>
            </totals>
        </order_invoice>
        <order_creditmemo>
            <totals>
                <insurance>
                    <class>insurance/sales_order_total_creditmemo_insurance</class>
                </insurance>
            </totals>
        </order_creditmemo>
    </sales> 
   </global>
 </config>   

Both are conflicting in total price , Please help how can i solve this issue.

Cœur
  • 37,241
  • 25
  • 195
  • 267
David John
  • 280
  • 3
  • 9
  • Can you explain with a scenario regarding how the price gets affected by both the modules ,how the insurance and fees totals get calculated etc. – Rohit S Sep 30 '14 at 10:25
  • i am using this extenstion http://excellencemagentoblog.com/magento-add-fee-discount-order-total , and i made a another copy of this extension , please see the problem in this question ....http://stackoverflow.com/questions/26100747/tax-calculation-is-wrong-in-magento – David John Sep 30 '14 at 10:29
  • 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. – David John Sep 30 '14 at 10:30
  • Are you sure that the tax is not added to Grand total only when these modules are enabled.?Also there are several setting's in Magento (System > Configuration > Sales > Tax ) using which we can include tax to the sutotal ,include tax to the product price etc. Please double check your tax display configuration here System > Configuration > Sales > Tax . – Rohit S Sep 30 '14 at 11:08

2 Answers2

2

This is the same issue which i faced ,Currently you are adding before tag only in one extension so remove this line.

<before>fee</before>

you have to set the after and before tag in both of the extension.

In Extension A Config.xml file use this

<after>subtotal,discount,shipping</after> 
<before>tax,grand_total</before> 

and in your Extension B Config.xml file use this

<after>fee</after> 
<before>tax,grand_total</before> 

Hope this will help yours

Vishal Sharma
  • 1,372
  • 1
  • 8
  • 17
0

The sort algorithm used by Magento is not stable and can lead to wrong results. You can use this patch: https://stackoverflow.com/a/11954867/288568

Community
  • 1
  • 1
Alex
  • 32,506
  • 16
  • 106
  • 171