I’m sort of desperate looking for a way to get Ajax add to cart working. I would prefer not to refresh the page when products are added to cart. I’m no coder, but this was no issue with Oxygen.
Is there some hidden settings that need to be enabled? Or anything that could be added to future release?
Ward.
I hope they give an answer on this topic.
This is the default behaviour for Woocommerce when viewing on a single product page. Here’s a tutorial ( include a free plugin instead of following the tutorial also) that changes that behaviour
It would be nice to add the ability to work the button to cart through ajax in the settings of the builder, so as not to connect unnecessary plugins.
you dont need a plugin for that!
It works, but the problem with this approach is that the button has a link to add product to cart. After clicking on the button product is added to cart and is immediately redirected to the cart page. In some cases this is justified, but mostly such redirection is unnecessary. After adding product to cart we need to stay on the same page with the list of products to continue browsing.
You can delete that part of the code, it’s all optional.
window.location.href = `${window.location.origin}/checkout`