google maps - Shopify updating of shipping/delivery free programmatically during checkout
Can shopify delivery/shipping fee be updated programatically during checkout? What I want to do for longer distance deliveries is use the Google API to calculate the distance difference between the my store and customer and increase the delivery fee if it is more than x miles (probably 10 miles).
You can use Shopify's carrier service API (https://help.shopify.com/api/reference/carrierservice) for this. When a customer checks out, Shopify will provide your app with the line items and shipping address and your app can send back the shipping options and prices.
You can use the Carrier Service API (https://help.shopify.com/api/reference/carrierservice) for that but you have to be on the Shopify Advanced plan (https://www.shopify.com/pricing).
A possible hack would be to add a surcharge to the cart as a product. You'd have to get the customer to register/login in the cart and keep them from going to the checkout until you have a shipping address and then add the surcharge product via script.
You may need an app for that but the $220/month difference between Shopify and Advanced Shopify offers some incentive to look for alternatives.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.