I can see that when $ quote->collectTotals()->save()
is called new methods and rates are are called within FedEx’s _formRateRequest()
method. However, when I change the shipping address and the save requests executes $ quote->getShippingAddress()->getShippingRatesCollection()->getFirstItem()->getCode()
I get the method/rate that applied to the previous address. When I place the request again, it returns the new value that I expect to see.
I tried the suggestion here but it did not resolve the issue.
EDIT
To be clear: I am working on a module that extends checkout. When the Shipping Address saveAction()
is called I want to automatically select the cheapest available shipping method for the customer and save it to the quote. However, the updated shipping methods saved to the quoted address are always one request behind.