New Shopify Certification now available: Liquid Storefronts for Theme Developers

how to know the subscript contract has free shipping discount

Yasuhiro
Shopify Partner
3 0 0

Hi. I work on implement discount code on subscription. If a subscription contract has free shipping discount, i need to avoid adding other discount code.

Are there any free shipping info on subscriptionContract or subscriptionDraft?

Replies 2 (2)
NPeneycad
Shopify Staff
Shopify Staff
13 3 3

Hi @Yasuhiro,

 

Here are our official docs on creating and managing discounts on subscriptions - specifically for your questions, you may be looking for Adding a free shipping discount to a subscription contract and Querying discount allocations on a subscription contract.

 

Hope this helps!

 

Cheers,

Noah  

To learn more visit the Shopify Help Center or the Community Blog.

Yasuhiro
Shopify Partner
3 0 0

Hi Noah.

Thanks your the reply.

I have already implemented the feature to add free shipping code by subscriptionDraftDiscountCodeApply and subscriptionDraftCommit. and I can make sure the subscription contract has free shipping if the subscription purchase completed and  got mail. (the mail mention the purchase has free shipping)

but I can't make sure the subscription contract has free shipping before  the purchase is not completed even I use the Querying discount allocations.

it it is "percentage discount" or "fixed amount discount", it is listed in "data.subscriptionDraft.lines.edges[].node.discountAllocations[]". but if it is free shipping discount, it is not listed on the place.

I'm looking for the other way..

 

Yasuhiro