Home Forums WoodMart support forum Refresh the minicart sidebar when a product is added

Refresh the minicart sidebar when a product is added

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #275442

    webreturn
    Participant

    Hi,

    We were wondering if there is any way to refresh the minicart sidebar when a product is added? Is there a snippet to do so? Something like a reload minicart page upon add to cart.

    We’ve added custom code (with related products in it) to the minicart sidebar (woodmart_cart_side_widget) which works fine so no assistance needed there but the cart is opened with Ajax and not reloading like a the regular cart page. When we refresh the page it reloads the minicart page and it works fine.

    I hope that you can point me in the right direction or share a snippet to make the minicart sidebar reload when clicking the add to cart instead of just updating the cart.

    Thanks!

    #275478

    Hello,

    By default, without any customization, the shopping cart widget updates the price and products added.

    Please deactivate all the plugins not related to the theme and switch the parent theme, check the issue, If the problem has gone, activate the plugins one by one, checking the issue to detect which one causes the problem.

    Best Regards

    #275643

    webreturn
    Participant

    Yes, it loads and updates the cart using AJAX but I would like it to actually reload the mini-cart.php that generatest he sidebar basket so that my function is shown. Is there any way to do so?

    We’ve added custom code (with related products in it) to the minicart sidebar (woodmart_cart_side_widget) which works fine so no assistance needed there but the cart is opened with Ajax and not reloading like a the regular cart page. When we refresh the page it reloads the minicart page and it works fine.

    I hope that you can point me in the right direction or share a snippet to make the minicart sidebar reload when clicking the add to cart instead of just updating the cart.

    #275644

    webreturn
    Participant

    We have purchased 24 licences for Woodmart for our customers. We are really appreciate it if you can help us with it.

    #275774

    Artem Temos
    Keymaster

    Hello,

    You need to add your custom code to the file mini-cart.php if you want to refresh it with AJAX. If it doesn’t help, please, provide us a screenshot and link to your website so we can better understand the problem.

    Kind Regards

    #276003

    webreturn
    Participant

    Hi, thanks.
    Plesse check https://www.maprostore.nl/antislipmat-r13-granulaat-60-cm-breed-antraciet/ if you put this into your shopping cart you can see this: https://prnt.sc/10u7rxg

    Then if you do this: https://www.maprostore.nl/antislipmat-r13-granulaat-60-cm-breed-antraciet/?LSCWP_CTRL=NOCACHE (this is the first load of the page and without cache) you can see the result (related products) into the shopping cart: https://prnt.sc/10u7ttz

    This isn’t in the first load if you put something into the shopping basket.

    Best regards, Tim

    #276027

    Artem Temos
    Keymaster

    Hello,

    Please, disable all external plugins and send us your admin and FTP access so we can check what is wrong with that.

    #276047

    webreturn
    Participant

    Hi, this is a live website and have lot of visitors. I can’t do this right now. Please check it on our website, we want that all the content of the cart sidebar is reloaded. Now it looks like that only the cart in it is reloaded.

    #276063

    Artem Temos
    Keymaster

    Sorry, but we can’t check it without this information. It is not a standard theme functionality and related to additional code customization so it might be some issue with your code.

    #276220

    webreturn
    Participant

    Hi, we have made a staging, see below in the private content the access.

    #276223

    Artem Temos
    Keymaster

    Try to copy the file woodmart/woocommerce/cart/mini-cart.php into your child theme woodmart-child/woocommerce/cart/mini-cart.php. Then, do all your customizations in that file instead of the PHP function woodmart_cart_side_widget.

    #276286

    webreturn
    Participant

    Great thank you! This is working : )

    #276298

    Artem Temos
    Keymaster

    Great, you are welcome! Feel free to contact us if you have any extra questions.

Viewing 13 posts - 1 through 13 (of 13 total)

The topic ‘Refresh the minicart sidebar when a product is added’ is closed to new replies.