Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gift card #660

Open
aykodesmedt opened this issue Jun 30, 2021 · 5 comments
Open

Gift card #660

aykodesmedt opened this issue Jun 30, 2021 · 5 comments

Comments

@aykodesmedt
Copy link

Is is currently possible to accept gift cards? A gift card code doesn't seem to work with addDiscount.

@Gomah
Copy link
Owner

Gomah commented Jul 1, 2021

Hey @aykodesmedt, have you tried using the following:

let checkout = await this.$shopify.checkout.create();
const giftCardCodes = ['yourGiftCardCodes', 'anotherOne'];

checkout = await this.$shopify.checkout.addGiftCards(checkout.id, giftCardCodes);

It's not document yet, but would add to the documentation / types if it works!

ref: Shopify/js-buy-sdk#770 (comment)

@aykodesmedt
Copy link
Author

Hi @Gomah,

Yes, I've tried that. When I use the code above, I get an array in the checkout appliedGiftCards, but the subtotal or total of the cart is the same as before adding the gift card.

@aykodesmedt
Copy link
Author

@Gomah

Hi! Have you been able to figure out something more about how to do this?

@Gomah
Copy link
Owner

Gomah commented Jul 26, 2021

@aykodesmedt Didn't get much time to look at it yet, feel free to email me with more details 👍🏻

@aykodesmedt
Copy link
Author

@Gomah

This code works, but the total or subtotal parameters aren't adjusted. You should look at paymentDue for the remaining amount of money the customer will now have to pay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants