[Resolved] Refreshing menu cart icon with Ajax?

Home Forums Support [Resolved] Refreshing menu cart icon with Ajax?

Home Forums Support Refreshing menu cart icon with Ajax?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1566120
    Ben

    Hi,

    I have just changed to GP and GP Premium and GenerateBlocks (and am delighted!)

    I have a problem with the WooCommerce cart menu icon, it gets cached by the Cloudflare caching plugin I’m using, so if I go to the store, add an item to cart, it will add the ‘1’ bubble next to the cart icon (https://snipboard.io/Kux13r.jpg), but if I go back to the homepage, the ‘1’ bubble won’t show as the icon is cached as empty for that page.

    The developer says “is the cart updated via Ajax? Ajax requests are never cached. You should activate the option (if exists) to update the cart number via ajax call. Cloudflare cache the page using the URL as key. So if the cart number is coming out with the main HTML, it’s a problem. You should make it dynamic with Ajax.”

    Is there anything to be done? I don’t want to turn off the caching plugin if possible. I wouldn’t mind having just the cart with no bubble for either cart items or cart total, but I can’t see that option. Is there anyway to do what the developer asks with Ajax?

    Thanks for any help,

    Ben

    #1566160
    Ben

    p.s. I’m not even sure I need this caching plugin (another point of confusion, the site seems very fast without it) so if it’s between the cart icon functioning right and the caching plugin, I’ll take the cart icon functioning.

    #1566310
    Leo
    Staff
    Customer Support

    Hi Ben,

    Caching plugins are definitely not required – we don’t use them ourselves.

    We only use Autopimize with the suggested settings here for this site:
    https://generatepress.com/fastest-wordpress-theme/
    https://docs.generatepress.com/article/configuring-autoptimize/

    You can try testing with and without the caching plugin and run your site through speed tests and see if you see any differences.

    Then also try with Autopimize.

    Let me know if this helps ๐Ÿ™‚

    #1566334
    Ben

    Thanks Leo for your reply, that’s a relief, if I forget that plugin, it’s all sorted. I’ll do some tests anyway as you suggest.

    #1566363
    Leo
    Staff
    Customer Support
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.