Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
I am currently using the js-shopify-buy SDK (via gatsby-plugin-shopify-buy [https://github.com/ginlane/gatsby-plugin-shopify-buy])
TLDR: when apply a discount code via shopify-buy, the checkout object reflects the discount code; however, the webUrl provided by the checkout object has a discount code error: "Unable to apply this discount code. Try again"
The issue is that when I apply a discount code to the checkout object, the checkout object via
shopifyClient.checkout
.addDiscount(checkoutID, discountCode)
the checkout object returned has the discount code applied, and the price object in the checkout object reflects the discounted price;
however, when I go to the `webUrl` provided by the checkout object, the shopify checkout page shows the error under the discount code input field:
What's going on? Is this functionality supported? Am I doing something wrong?
P.S:
1) When I type the discount code that I applied programmatically (DISCOUNT2021) on the shopify checkout page, the discount code is successfully applied (so I assume there is no error with the discount code)
2) When I add another product to my checkout AFTER programmatically applying the discount, the discount shows up on the shopify checkout page.
Hey @kcdave,
Would you be able to provide us with X-Request-Id returned for of a recent API request you have sent following this process? Also, please feel free to provide a checkout token, URL, or any other steps used from the JS Buy SDK and Storefront API to generate a checkout.
awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Is there any update on this? We are facing the exact same bug. But we notice that after we add a second item to the cart after adding the discount code. The discount is correctly applied in the checkout
User | RANK |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |