Home › Forums › WoodMart support forum › Refresh the minicart sidebar when a product is added
Refresh the minicart sidebar when a product is added
- This topic has 12 replies, 3 voices, and was last updated 3 years, 11 months ago by
Artem Temos.
-
AuthorPosts
-
March 22, 2021 at 1:35 pm #275442
webreturnParticipantHi,
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!
March 22, 2021 at 3:39 pm #275478
Elise NoromitMemberHello,
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
March 23, 2021 at 7:38 am #275643
webreturnParticipantYes, 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.
March 23, 2021 at 7:40 am #275644
webreturnParticipantWe have purchased 24 licences for Woodmart for our customers. We are really appreciate it if you can help us with it.
March 23, 2021 at 2:27 pm #275774
Artem TemosKeymasterHello,
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
March 24, 2021 at 11:25 am #276003
webreturnParticipantHi, 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/10u7rxgThen 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
March 24, 2021 at 12:31 pm #276027
Artem TemosKeymasterHello,
Please, disable all external plugins and send us your admin and FTP access so we can check what is wrong with that.
March 24, 2021 at 2:09 pm #276047
webreturnParticipantHi, 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.
March 24, 2021 at 9:15 pm #276063
Artem TemosKeymasterSorry, 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.
March 25, 2021 at 9:55 am #276220
webreturnParticipantHi, we have made a staging, see below in the private content the access.
March 25, 2021 at 10:15 am #276223
Artem TemosKeymasterTry to copy the file
woodmart/woocommerce/cart/mini-cart.php
into your child themewoodmart-child/woocommerce/cart/mini-cart.php
. Then, do all your customizations in that file instead of the PHP functionwoodmart_cart_side_widget
.March 25, 2021 at 2:43 pm #276286
webreturnParticipantGreat thank you! This is working : )
March 25, 2021 at 3:08 pm #276298
Artem TemosKeymasterGreat, you are welcome! Feel free to contact us if you have any extra questions.
-
AuthorPosts
The topic ‘Refresh the minicart sidebar when a product is added’ is closed to new replies.
- You must be logged in to create new topics. Login / Register