1

I am trying to create my custom shipping method everything is okay but I see that magento is calling my collectRates function twice

I wasn't able to figure why magento doing this

I had tried to test it on fresh installation of magento and same case happen

any suggestions would be appreciated

1 Answer 1

4

The collectRates() methods gets called every time when Magento recalculates the quote totals. Magento recaculates the totals whenever it thinks the totals may have changed.

E.g. when checking out with one shipping methode enabled (vanilla installation), collectRates() is executed when

  • when the entered shipping address is saved (starting at Mage_Checkout_OnepageController::saveShippingAction())
  • when the selected payment method is saved (starting at Mage_Checkout_OnepageController::savePaymentAction())

Both the shipping address and the payment method can have effects on the total amount and totals of the order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.