• Resolved mw815371

    (@mw815371)


    Hi there,

    very nice plugin.

    However, while testing I found a strange behavior. When I add items to the cart it displays the right count on any page of my website correctly. Only Exception is the Homepage there it shows 0 items and has a link to the shop instead to the cart.

    This happens on all websites I have tested the plugin. Thus I guess you got to adjust your code that in case there are items in the cart, it should always point to cart page and only if the cart is empty it links to the shop no matter which page of a website is visited.

    Thanks for looking into it.

    Best,
    Stephan

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hello Stephan,
    Could you provide a link to your site so we can check what’s happening? It sounds like you may be using a plugin for server side caching in combination with the WooCommerce scripts are not loaded on the homepage. By default these scripts would load anywhere, but if you’re using the same setup on all your sites (server side caching + disabling scripts on specific pages), this may cause the behavior you describe. A quick glance at one of the sites would allow us to check this hypothesis ??

    Thread Starter mw815371

    (@mw815371)

    Hi Ewout,

    you are right. It works when all woocommerce scripts are enabled everywhere.

    But that’s not what I want as it slows down page loading time on pages where no woocommerce is needed.

    However, it is interesting that the Menu Cart works fine on all pages expect the homepage, when the woocommerce scripts are only enabled for woocommerce pages.
    To me this is strange.

    I’ll continue testing until I find a configuration that gives me what I’m looking for.

    Thanks for your help.

    Best,
    Stephan

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Stephan,
    Normally the WooCommerce scripts would indeed only be needed on the WooCommerce pages, but if you have server side caching enabled, the count will always be wrong (mostly 0) on the cached pages, and the AJAX scripts replace these dynamic elements with the most up to date count – that is all done by the WooCommerce AJAX fragments script.

    I don’t know why the menu cart works on the other pages, perhaps that’s also related to how caching is configured? If those pages are not served from cache, the AJAX scripts are not needed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Menu cart Icon not displaying item count on homepage’ is closed to new replies.