Hide a shipping method when a specific coupon used

nickblue
New Member
3 0 0

Hi, guys

Just wondering how I can hide a shipping method when a specific coupon used in checkout.

As a web developer, any API is available for this kind of situation?

Your help will be appreciated.

 

0 Likes
michaeltheodore
Explorer
59 6 8

What framework are you using?

0 Likes
nickblue
New Member
3 0 0

Hi, Michael

Do you mean what framework I'm gonna use in my App?

 

0 Likes
michaeltheodore
Explorer
59 6 8

Are you using the Storefront API?

0 Likes
nickblue
New Member
3 0 0
I could use Storefront API.

Can you please give me an example of how to achieve this?
0 Likes
michaeltheodore
Explorer
59 6 8

There is no shipping method object in the Storefront API. Only the Admin API has it.

If you don't want to add a shipping method at checkout, you don't have to.

 

0 Likes
Mircea_Piturca
Shopify Partner
1489 42 316

If you are on Plus, you can do this via Scripts: https://help.shopify.com/en/manual/checkout-settings/script-editor

You would create a Shipping Script, detect the coupon used, and disable the gateway.

Finally—Add variant descriptions to your products
0 Likes
michaeltheodore
Explorer
59 6 8

All Shopify plans include discount codes. There is a limit of 20,000,000 unique discount codes for each store.

https://help.shopify.com/en/manual/discounts/create-discount-codes

0 Likes