• Resolved peterhsbi

    (@peterhsbi)


    Hi there,
    love the plugin. Solved a lot of runtime issues for me. ??

    One little thing though: on first page load when the cart is still empty the mouse over on the cart only produces the borders of the popup cart (so essentially only a line) without any content e.g. “cart is empty”. Once I send a product to the cart and then delete it from there, the message for empty cart shows up as expected.

    Running on WordPress 4.5.1, WooCommerce 4.1.0

    Any ideas?

    Cheers,

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimocha

    (@optimocha)

    Hey @peterhsbi,

    Because of being isolated with your website, I think this looks like an issue that you need to talk with the theme’s developer I’m afraid ?? They need to set the default cart hover action without the need of a cart fragment – you can send this thread’s link to them if you want to.

    Thread Starter peterhsbi

    (@peterhsbi)

    Hi,
    thanks for getting back to me so quickly.

    I did some more digging – including testing on Storefront theme.

    Unfortunately I can’t confirm your evaluation. The unwanted behaviour seems to originate from the missing cookie(s) on page load. After first page load three new cookies get generated when putting an item into the cart. I assume they get modified when deleting the item again. In any case – once the item is empty again the three cookies are still there and the cart behaves like expected and shows a “Cart is empty message” instead of nothing (Storefront theme) or a part of the message border (Astra theme).

    So it looks like the answer would be to generate the appropriate cookie(s) on first page load to solve the issue.

    Plugin Author Optimocha

    (@optimocha)

    That’s actually the cart-fragments.js script’s job, creating the cookie with an empty cart ?? And that’s the reason the script makes an AJAX request, which is the reason that the script slows down a website, which is the reason the Disable Cart Fragments plugin exists :).

    By logic, themes should have a “default state” of their cart icons or cart flyouts or whatever they have in their theme headers (“cart fragments” in short). If WooCommerce does provide a cart fragment, great, the theme updates the default fragment with the provided fragment. If not, the default fragment would show an empty cart without any issue. That’s what most (almost all) themes do, so the theme developer is responsible for the issue you’re experiencing.

    Thread Starter peterhsbi

    (@peterhsbi)

    Fair enough ??

    But I think we can agree that it is a bit more than just ironic that of all themes I could have tested, I chose Storefront – assuming it to be the gold standard for WooCommerce compatibility – and managing to pull another rabbit out of the hat instead.
    I’ll pass it on to Astra. Or – I might actually look into placing that default cookie myself. Should be within reach of my coding-foo. ??

    Plugin Author Optimocha

    (@optimocha)

    It’s not a bad idea to set a default cookie –maybe even a future version of Disable Cart Fragments could do it too– but for now, firing that initial AJAX call kind of defeats the purpose of removing the cart-fragments.js script ??

    Thanks for this conversation though! Certainly, this is going to be useful for DCF’s future.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Mouse over on empty cart’ is closed to new replies.