Sidebar cart icon problem with cached pages
-
The problem is that we have cache plugin (litespeed cache) that caches most pages. Then when it is cached, it will save the cached version of like this:
<div class="vi-wcaio-sidebar-cart-icon-wrap vi-wcaio-sidebar-cart-icon-wrap-bottom_left vi-wcaio-sidebar-cart-icon-wrap-click vi-wcaio-disabled">
And then the visitor who has stuff in his/her cart doesn’t have the cart icon visible. Problem seems to be that it is decided in the backend will the
vi-wcaio-disabled
class be added to thevi-wcaio-sidebar-cart-icon-wrap
or no, and when the page is cached it just might be wrong version for current user.I think the cart icon visibility should considered after getting ajax call getting the amount of stuff in the cart. Then it would work with cached pages as well.
I now went around the problem by forcing the
vi-wcaio-disabled
to always show using css rule. However, this is not great solution, since now the cart icon will show even when user has it empty.The page I need help with: [log in to see the link]
- The topic ‘Sidebar cart icon problem with cached pages’ is closed to new replies.