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 item count not reset after successful order #165

Open
nx-andreashabermann opened this issue Dec 2, 2024 · 1 comment
Open

Cart item count not reset after successful order #165

nx-andreashabermann opened this issue Dec 2, 2024 · 1 comment

Comments

@nx-andreashabermann
Copy link

Describe the bug
After successfully creating and order, the customer still sees the basket count for the basket already submitted in the header.

To Reproduce
Steps to reproduce the behavior:
1 Add a product to the cart and proceed to checkout
2. Complete the payment step
3. Stay on the Order confirmation page and check the cart in the header, it still shows the number of items that were in the before the order was created

Expected behavior
The cart should be empty after a successful order

Screenshots
You can see the behavior in the video uploaded for #150

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome
  • Version: latest

Additional context
The implementation does not use createOrder from commerce-sdk-react but uses commerce-sdk-isomorphic directly. This prevents that the tanstack cache for the basket is invalidated as it should be on order creation. Header uses the cached version to display the cart count.

@amihajlovski
Copy link
Collaborator

Hello @nx-andreashabermann

We are aware of this issue, but since its not coming from our npm package we leave that to merchants to send an additional call to the basket in order to refresh the counter.
The retail app that we have as part of this repository is only for demo purposes.

Kind regards,
Aleksandar
Adyen

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