Showing results for 
Search instead for 
Did you mean: 

event sales_quote_address_collect_totals_after is changing paid amount

event sales_quote_address_collect_totals_after is changing paid amount

Hi Team,

I am adding some custom value in my tax amount after select country by using sales_quote_address_collect_totals_after even, everything is working fine but after complete the online payment my paid amount increase by this custom tax value means grand total and paid amount is different, paid amount is more than grand total, even at the time of payment gateway show correct grand total value but after payment paid amount increase by custom tax value.

Below is the code that I am using to increasing tax value

 $total->addTotalAmount('tax', $this->additionalTaxAmt);

Seems event is calling after complete the payment and increasing paid amount.
Anyone have idea how to solve this?


Re: event sales_quote_address_collect_totals_after is changing paid amount

Hello @webkeonsanjeev 


  1. Instead of using the sales_quote_address_collect_totals_after event, you can try using a different event that occurs before the payment is processed. For example, you can use the sales_quote_collect_totals_before event, which is triggered before the totals are collected and processed.

  2. Make sure the priority of the event observer  sales_quote_address_collect_totals_after is set appropriately. If it has a high priority, try reducing it so that it executes earlier in the event chain.

  3. Review the payment process implementation to ensure that it correctly handles the additional tax value and updates the paid amount accordingly. Check if there are any modifications or calculations being applied during the payment process that might be affecting the paid amount incorrectly.

  4. Insert debug statements or log messages in the event observer method and the payment process code to track the flow of execution and identify any discrepancies or unexpected behavior.

  5. Try testing the payment process with different payment methods to determine if the issue is specific to a particular payment method. It's possible that the problem lies within the integration of the payment method you're using.

  6. Instead of modifying the tax amount directly in the sales_quote_address_collect_totals_after event, you can explore other approaches. For example, you can consider using a custom attribute to store the additional tax value temporarily and apply it during a different event or at a different point in the payment flow.

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now