I have override the tax calculation module class "Magento\Tax\Model\Calculation" and pass the class in "\Magento\Checkout\Model\Cart" in constructor function as a dependency injection.

My requirement was to change the tax calculation when end user change to shipping method.therefor I used the class \Magento\Checkout\Model\Cart to get the shipping method name.

It was working and getting the shipping method when end user change from frontend and on the basis of shipping method name changing the logic to fulfill the requirement.

Now when click on button Place Order to make the order I am getting below error.

"infinite loop detected review the trace for the looping path" .

Can anybody have idea why this error occurring and what's the other way to get the shipping method in tax calculation class.

I have tried many methods but not getting any work.Please help.

Below is the reference what I did.



  • please update your question with the new class you created that override the base class. – Rendy Eko Prastiyo Aug 28 '20 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.