Home Forums WoodMart support forum Recently Viewed widget not working with page caching plugins like WPRocket

Recently Viewed widget not working with page caching plugins like WPRocket

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #539145

    dimmisel
    Participant

    Hello, I noticed that the recently viewed products widget is not compatible with page caching plugins like WPRocket, despite what your documentation says.

    The problem is that the woodmart_recently_viewed_products cookie is set only during PHP load, and not through JS. So, when a page is already cached and is fetched from page cache, then the cookie is not getting updated. You have to visit a non-cached product page to see this product in your recently viewed section, but this will work only for the first visitor. All following visitors will load the cached version and the problem will appear again. Essentially this widget actually works fine for very very few users.

    I found a similar topic ( https://xtemos.com/forums/topic/recently-viewed-work-only-on-adminpage-when-connected/ ) with the same problem and you posted a JS snippet that maybe solves the issue. But can you include the fix in the default woodmart recently viewed products JS file, so that we don’t have to include the snippet in every installation? Plus, this JS snippet should be loaded only in pages where this widget exists like its JS file, and not in all pages like Custom JS setting.

    Thank you

    • This topic was modified 10 months, 1 week ago by dimmisel.
    #539191

    Artem Temos
    Keymaster

    Hello,

    Yes, it is a known issue and we will improve this mechanism in our next theme update. Note that it is how the default WooCommerce widget works as well.

    Kind Regards

    #539206

    dimmisel
    Participant

    Ok great, I can’t wait! Unfortunately WooCommerce does many things in a non-optimal way 🙁

    Since you are in the process of improving it, maybe it’s a good idea when the user sees a specific product page, this same product to not appear in the recently viewed section. It doesn’t make a lot of sense to see it there.

    Thank you Artem

    #539372

    Artem Temos
    Keymaster

    OK, we will check this as well. Feel free to contact us if you have any further questions.

Viewing 4 posts - 1 through 4 (of 4 total)