Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
It appears that when I try to apply a discount code via cartDiscountCodesUpdate
- The code is applied
- The code is returned in Cart.discountCodes
However, Cart.discountCodes[0].applicable is set to false but the total for the cart has changed to reflect the applied discount.
I'm applying a 10% Off coupon and my query looks like this:
mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!, $contextCountry: CountryCode!) @inContext(country: $contextCountry) {
cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
cart {
...CartFragment
}
userErrors {
field
message
}
}
}
I should also add, the documentation here has the wrong method signature:
https://shopify.dev/api/storefront/2022-01/mutations/cartDiscountCodesUpdate
Thanks,
Stephen
Solved! Go to the solution
This is an accepted solution.
Hi @steveb3210 ,
I just wanted to follow up to let you know an issue has been created on our end to address the applicable issue noted with discount codes. I can't share any timelines on when the issue will be resolved but can update you when I know more.
I've also reached out to the docs team about the code sample having the error so we'll get that taken care of as well.
Regards,
John
John C | Developer 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
This is an accepted solution.
Hi @steveb3210 ,
I just wanted to follow up to let you know an issue has been created on our end to address the applicable issue noted with discount codes. I can't share any timelines on when the issue will be resolved but can update you when I know more.
I've also reached out to the docs team about the code sample having the error so we'll get that taken care of as well.
Regards,
John
John C | Developer 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
< Nevermind, the API changed to handle different types of allocations >