Development discussions around Shopify APIs
tl;dr
The full story:
Stack: consuming the Buy API using the shopify-buy npm package in a React application.
Steps to reproduce:
shopifyClient.checkout.addLineItems(checkoutId, lineItemsToAdd);
shopifyClient.checkout.addDiscount(checkoutId, discountCode);
shopifyClient.checkout.updateLineItems(checkoutId, lineItemsToUpdate);
BUG: The response object shows the manually applied discount code (from step 2) in `checkout.discountApplications`, but the total doesn't reflect the discount, and the `lineItems` do not have the discount in their `discountAllocations`.
EXPECTED BEHAVIOR: The response should show the manually applied discount in each of the `lineItems` that it applies to, and the total should reflect the manually applied discount as well.
The very next time you do anything to update the cart (or, just request the cart state (e.g. using `shopifyClient.checkout.fetch(checkoutId)`, it accurately reflects the manually applied discount code in the total, on the line items, and in `checkout.discountApplications`.
My workaround for the moment is:
Please help.
Thanks in advance!
As a business owner, have you ever wondered when your customer's first impression of yo...
By Skye Jun 6, 2023We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023