0
votes

Is it possible to dynamically specify the shipping method for Magento's free shipping module?

This is the logic I want to setup:

To US: Free shipping through UPS ground. To Canada: lowest rate from USPS or UPS APIs

I saw this post which provides a way to retrieve the cart's shipping methods: Magento : Get all Shipping Rates

$quote()->getShippingAddress()->getGroupedAllShippingRates();

I was thinking finding a hook in the checkout process, finding the lowest quote, and adding it to the notes. I am concerned about changing the shipping method as it may affect the price.

1

1 Answers

1
votes

I solved this by creating a checkout observer which saved the lowest shipping method returned from the api to the order comments if the customer selects the free shipping method.