Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
294 views
in Technique[技术] by (71.8m points)

ruby - Show a shipping rate based on zip, province and country in shopify

I would like to show a shipping rate if zip code matches a number of zip codes, and county is GB and hide that shipping rate otherwise. Shopify has a sample but

  • it accepts singe zip code
  • it need province, this is not applicable in uk
  • it hides rates that are not given in list. I would like to display them. sample is available here.

https://help.shopify.com/en/manual/checkout-settings/script-editor/examples/shipping-scripts#show-rates-for-a-specific-zip-code-province-and-country

Any help will be highly appreciated.

question from:https://stackoverflow.com/questions/65919801/show-a-shipping-rate-based-on-zip-province-and-country-in-shopify

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you are not on Plus, your best bet is to register a CarrierService. Shopify will send all checkouts to that service. In your service, you audit the payload. Depending on the contents, like country, zip etc, you can either return a rate or not. This solves your problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...