• I love this plugin and it works great! The only issue I have is that the notice “Sorry, [product] was removed from your cart because you didn’t checkout before the expiration time.” is being cached on shop and product pages, so it’s shown to other users who didn’t have that item in their cart.

    Google tells me this is because the notice isn’t being delivered by Ajax, but I’m not sure. I already have the WooCommerce notices cookie set to not cache (I’m using Litespeed cache). The notice stays even after refreshing the page.

    I don’t have object or database caching enabled, only page caching (CSS and JS too) and PHP resources.

    Please can you help?

    • This topic was modified 4 years, 2 months ago by thelyall.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter thelyall

    (@thelyall)

    I read in another topic about disabling caching on shop pages, but that doesn’t seem like a suitable solution considering this is a WooCommerce plugin, so you’d basically be saying to disable caching on the site…

    Hopefully we can just stop the notices being cached as part of the shop and product pages ??

    Plugin Author James Golovich

    (@jamesgol)

    Unfortunately the plugin uses WooCommerce notices to display those messages so it’s going to be included on the pages. The same thing would happen with other WooCommerce notices so I’m surprised you haven’t run into this issue in the past.

    Thread Starter thelyall

    (@thelyall)

    Hi James,

    Thanks for the quick reply. In that case yes it is strange, this is the only notice that seems to be cached. But it could be that there are no other notices in use that appear on the first page load which is used for the initial cache.

    For example if the cart has expired and you visit a product page, the notice is already showing, and the page hasn’t been viewed before by anyone else so it’s cached including the notice. Other notices such as those after adding the product to card don’t appear on the initial page load so aren’t cached, as they are shown later after some interaction. I’m not 100% how it works but that might explain it, as the notice appears to be cached in that scenario.

    Thanks

    Thread Starter thelyall

    (@thelyall)

    Another thought – notices such as the ‘has been added to your cart’ notice include an ‘x’ to dismiss the notice and I believe uses the store_notice cookie which I’m excluding from caching.

    Plugin Author James Golovich

    (@jamesgol)

    I’ll have to do some more research when I have free time, you’re probably right most of the notices generated are shown on the cart/checkout page.

    Patches always encouraged ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Expired notice being cached’ is closed to new replies.