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

Cart not emptying on checkout completion #117

Open
mattdjenkinson opened this issue Jan 28, 2022 · 3 comments
Open

Cart not emptying on checkout completion #117

mattdjenkinson opened this issue Jan 28, 2022 · 3 comments

Comments

@mattdjenkinson
Copy link

Hey, just wondering if anyone else has run into this issue I'm having or if anyone can help.

I'm using the embedded checkout and once a checkout is complete the cart doesn't empty unless you do a full page refresh.

I'm using the "useCart" hook to display cart info.

Thanks

@mattdjenkinson
Copy link
Author

Update

I've used the "onComplete" option from the embedded checkout to revalidate the cart which is working. Is this how it's supposed to be used?

Thanks

@jorgemasta
Copy link
Contributor

Hey @mattdjenkinson, where are you setting that onComplete option?

@mattdjenkinson
Copy link
Author

mattdjenkinson commented Feb 2, 2022

Hey Joe,

I'm setting it when calling the embedded checkout.

` await module.embedCheckout({

          containerId: "checkout",

          url: embedded_checkout_url,

          styles: styles,

          onSignOut: () => logout(),

          onComplete: () => revalidate(),
        });`

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