Home › Forums › WoodMart support forum › Cart quantity icon cache problem with wp-rocket
Cart quantity icon cache problem with wp-rocket
- This topic has 7 replies, 2 voices, and was last updated 2 years, 11 months ago by Elise Noromit.
-
AuthorPosts
-
January 5, 2022 at 2:11 pm #343599
[email protected]ParticipantHi, we are dealing with the follow problem.
We are using wprocket for caching our site. Everything works great except that the quantity icon shows cached values.
For example if you visit homepage and then a product page and you add a product in the cart. In that product page that you add the product, the quantity will be become “1”.
But when you go back to the homepage that is already been cached from previous visit, the quantity will be “0”.So, we need not to caching the quantity on the cart icon.
We use the follow suggestions from wp-rocket:
1. https://docs.wp-rocket.me/article/1436-mini-cart-cached-already-has-product-in-it
This plugin didn’t help – The problem remained2. https://docs.wp-rocket.me/article/27-using-wp-rocket-on-your-ecommerce-site#cart-widgets
We exclude from WP Rocket → Advanced Rules and enter the following value in the Never Cache Cookies field: woocommerce_items_in_cart
With that field saved on the wprocket, the icon fixed but it fixed because the cache page stopped. With that settings every time you visit a page, the page loads from the start so we don’t have caching in our site.After explain those to wp-rocket support they answered the follow:
“If this plugin – WP Rocket | Deactivate WooCommerce Refresh Cart Fragments Cache – doesn’t help, and if the only way to make it work is to prevent caching, then it means that your cart icon has not been coded in a way that is compatible with caching. So we won’t be able to fix this on our end.Please see the “Cart Widgets” section here:
https://docs.wp-rocket.me/article/27-using-wp-rocket-on-your-ecommerce-site#cart-widgetsThe cart icon needs to be coded with Ajax/JavaScript so that it can accurately display the quantity even when the page is cached. This is something you will have to speak with your developer, or the theme support about. Currently they are adding the quantity directly into the HTML, so it gets cached and it won’t by dynamic (i.e. it won’t change/update).
Instead they need to fetch and display the quantity using an AJAX request. This will always be accurate even with caching”
So, please we need your help.
Thank you on advance- This topic was modified 2 years, 11 months ago by [email protected].
January 6, 2022 at 1:18 am #343701
Elise NoromitMemberHello,
I have checked the documentation provided by WP Rocket, I see the recommendation on the advanced rules.
Please check this article and make sure you have excluded all the recommended files: https://space.xtemos.com/wordpress-performance-optimization-the-ultimate-guide-in-2021#Step_4
If you have already excluded the list of the files and the problem persists, please let us know.
Best Regards
January 6, 2022 at 8:24 am #343743
[email protected]ParticipantDear Partners,
I have the checked the documentation and me.
I gave you private details to login to check by yourself and to see why is not working.
So, i have exclude all about the documentation, so PLEASE login to the site and see by yourself that everything is setuped correctly and after that check why is not working.Thank you in advance.
January 6, 2022 at 1:59 pm #343840
Elise NoromitMemberHello,
Please add this line into the functions.php of the child theme:
add_filter( 'woodmart_update_fragments_fix', '__return_false' );
Best Regards
- This reply was modified 2 years, 11 months ago by Elise Noromit.
January 13, 2022 at 7:45 am #345046
[email protected]ParticipantThanks for your reply. worked fine but we have the same problem with the wishlist quantity icon
can you send us a filter to exclude this too?
January 14, 2022 at 3:08 pm #345432
Elise NoromitMemberHello,
Please describe step by step how we can reproduce the problem.
Best Regards
January 15, 2022 at 9:23 am #345564
[email protected]ParticipantWe have active wp rocket and perfectly working.
One problem of the wprocket is that preload works only for not logged in users. If a user logged in stops seeing cached pages.
For this problem there is a solution based on this articleSo, what we do is that activated the plugin
WP Rocket | Common Cache For Logged-in UsersThis plugin solves this problem but created the following problem
It is caching the quantity icon of the wishlist, so all the logged in users sees the same quantity on the icon!
For example if one logged in user adds 4 products in the wishlist and this page cached at this moment, every logged in user will see the quantity wishlist icon to appear 4 products in their wishlist, even if they don’t have nothing in their wishlist.The problem is not when the user visit on the wishlist page because we have exclude that page from caching.
The problem is only in the quantity wishlist icon.
As wp-rocket said you are the only, that you can help because we need a filter fuction to exclude it based on the theme.
January 17, 2022 at 10:39 am #345853
Elise NoromitMemberHello,
Our developers are working on this issue and this would be fixed in the nearest update.
If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
Tagged: Cache
- You must be logged in to create new topics. Login / Register