You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
I just finished creating a Next.js app using the Storefront API.
However I can't see that there's a way to query the API to see if a checkout was completed, which
could be used to unset localStorage/cookie used to store a user's cart items...
As the checkout flow lives on another domain this is a bit tricky, my "work-around" fix was to create an API route to unset the cookie that contains the cart info server-side, and add a redirection to the home route.
So once the user ends up on the order confirmation page, a script runs to redirect them to the defined API route on the custom frontend...
It's a bit hacky and it's not the best UX.... also there's a risk that a user will close the window before the timeout...
Did I miss something crucial in the docs? Or was this scenario simply not considered?
Thank you!
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I just finished creating a Next.js app using the Storefront API.
However I can't see that there's a way to query the API to see if a checkout was completed, which
could be used to unset localStorage/cookie used to store a user's cart items...
As the checkout flow lives on another domain this is a bit tricky, my "work-around" fix was to create an API route to unset the cookie that contains the cart info server-side, and add a redirection to the home route.
So once the user ends up on the order confirmation page, a script runs to redirect them to the defined API route on the custom frontend...
It's a bit hacky and it's not the best UX.... also there's a risk that a user will close the window before the timeout...
Did I miss something crucial in the docs? Or was this scenario simply not considered?
Thank you!
The text was updated successfully, but these errors were encountered: