Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Mini-Cart block shows wrong total if theres multiple installs on the same domain #11168

Closed
passatgt opened this issue Oct 6, 2023 · 1 comment · Fixed by #11257
Closed

Mini-Cart block shows wrong total if theres multiple installs on the same domain #11168

passatgt opened this issue Oct 6, 2023 · 1 comment · Fixed by #11257
Assignees
Labels
block: mini-cart Issues related to the Mini-Cart block. type: bug The issue/PR concerns a confirmed bug. type: community contribution

Comments

@passatgt
Copy link

passatgt commented Oct 6, 2023

Describe the bug

If you have multiple WooCommerce sites on the same domain, the mini-cart block will often show the wrong cart total in case you started a cart on another site.

To reproduce

Steps to reproduce the behavior:

  1. Setup Site A on domain.com, lets use EUR as the currency
  2. Setup Site B on domain.com/test and use USD as the currency
  3. Add something to the cart on Site A
  4. Go to Site B and the mini-cart will show the cart total coming from Site A, even the currency will be EUR.

Expected behavior

Obviously it should display the correct cart total in this case.

Additional context

I'm guessing this happens because some of the mini-cart data is stored in local storage and that is tied to the domain only, not the path. To give you a real-world use case, some multilingual stores might be setup on /en and /de paths as separate WP/WC installs.

@passatgt passatgt added the type: bug The issue/PR concerns a confirmed bug. label Oct 6, 2023
@tarhi-saad tarhi-saad added the block: mini-cart Issues related to the Mini-Cart block. label Oct 9, 2023
@dinhtungdu dinhtungdu self-assigned this Oct 16, 2023
@dinhtungdu
Copy link
Member

Hi @passatgt, thanks for reporting this issue. I can reproduce it and and submitted #11257 to fix this issue. If you have time, please go to the PR and test it. You can find a zip build created for that PR in the comment section.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: mini-cart Issues related to the Mini-Cart block. type: bug The issue/PR concerns a confirmed bug. type: community contribution
Projects
None yet
3 participants