Closed gigitux closed 1 year ago
This PR fixes things with the cart widget, but not with the cart that is present in the menu, here on the right of the screen.
This PR fixes things with the cart widget, but not with the cart that is present in the menu, here on the right of the screen.
Thanks for the feedback! Could you share some reproduction steps, please?
This is an attempt that I did and it seems that works correctly:
Try it on the homepage or other none woo page (and without mini cart) ?
Here you can see that the cart is updating on the WooCommerce pages, but not on the Contact page:
https://github.com/woocommerce/storefront/assets/87852864/c330dbe1-05be-4896-89d3-82dc37140dfd
Yeah this doesn't fix the cart at the top right as I also reported in #2114. I don't use the mini cart. The top right cart is part of the storefront templates, that header is used all over my site. Ehm, just a layman, but that function to only include it on some pages based on conditions - if you're running storefront with that cart always in the header, what is the purpose?
@gigitux I agree with @webwit, since by default the cart (not the widget) is part of the navigation and is present on every page, it should get refreshed with wc-cart-fragments-script on every page, no exceptions.
Hi @webwit and @A-Printer, thanks for your suggestions! 🙌
Could you have a look at this new PR https://github.com/woocommerce/storefront/pull/2116 and see if it fixes the issue for you? Thanks a lot!
Hi Alba,
I'm out and didn't test, but that should do it as yesterday I outcommented the call to add_filter to limit_cart_sync_to_wc_pages and that fixed it for me. #2116 removes that and effectively does the same.
@albarin I can confirm that #2116 does fix the issue. Thanks!
Thank you both for your help! We'll create a new release as soon as possible.
Fixes #2114
With #2113, we start to enqueue the
wc-cart-fragments-script
only on WooCommerce Pages, but theMini Cart Widget
can be loaded in all the pages of WordPress. So, I update the logic to ensure that the script is loaded when theMini Cart Widget
is active.Screenshots
How to test the changes in this Pull Request:
On Sale Products
block (it is important that it is an old block that it is server side). Save it.-
Changelog