Cart Widget in Header - by Castro - on WordPress WooCommerce support

Solved9 replies4 participantsUpdated by Robert Hall

  • Avatar: Castro
    Castro
    Participant

    Hello,

    I am wondering if there is any possibility to enforce the Header Cart Widget to update after page load (like adding a product into the cart that only reloads the cart but not the whole page). I would like to cache the site because of performance reasons and that would be really helpful.

    Thanks in advance
    Nelly

    9 Answers

    Avatar: Jack Richardson
    Jack Richardson
    Support staff

    Hello,

    Can you please provide us with the link to your site and describe how to replicate this issue?
    Also give us wp-admin credentials in private content.

    Thank you.
    Best regards,
    Jack Richardson.

    Avatar: Castro
    Castro
    Participant

    Hello Jack,

    Thanks for answering. For performance reasons I use W3total Cache and would like to switch on page caching as well. Then, the cart icon and the pop-up cart are “hard coded” into the HTML and delivered the way the information was cached.

    I have seen that the cart is updated after pressing “Add to cart” in the shop page for instance without reloading the whole page. Therefore, my idea is to trigger the cart-update unce the HTML is completely loaded.

    I am sure that is possible, just don’t know how and hope you can help.

    Please, contact administrator
    for this information.
    Avatar: Eva
    Eva Kemp
    Participant

    Hello,

    I’ve disabled “Object Cache” in Performance > General Settings.
    Please clear your browser cache and check cart after that.

    Regards,
    Eva Kemp.

    Avatar: Castro
    Castro
    Participant

    Hi Eva,

    my question was concerning how to update the cart automatically after the HTML of a page is loaded completely. I want to use the page caching but that conflicts with the way the widget is loaded initially.

    Avatar: Eva
    Eva Kemp
    Participant

    Hello,

    Unfortunately we don’t have such feature in the theme.
    Sorry.

    Regards,
    Eva Kemp.

    Avatar: Castro
    Castro
    Participant

    Hi Eva,

    Could you tell me the name of the function that reloads the cart widget at least? Then I could find someone to write me a snippet.

    Thanks

    Avatar: Eva
    Eva Kemp
    Participant

    Hello,

    You can find the code in wp-content/themes/legenda/js/etheme.js (lines 1366-1377).

    Regards,
    Eva Kemp.

    Avatar: Castro
    Castro
    Participant

    Hi Eva,

    many thanks!

    Avatar: Robert Hall
    Robert Hall
    Participant

    Hello,

    You’re welcome!

    Regards,
    Robert Hall.

The issue related to '‘Cart Widget in Header’' has been successfully resolved, and the topic is now closed for further responses