Replies: 0
I’ve created a Woocommerce site where all the products are listed in a basic table format and they get added to cart directly on the listing page (without going through a single product page) via Ajax. It’s very important that the cart is on the same page so I have put the cart shortcode in a popup modal to have it appearing without a page reload when a button is clicked.
Mostly it’s working. Only when there are no products in the cart, it doesn’t automatically update when a product is added. I’ve created a custom function to load the cart va Ajax the first time. Other than that, the cart refreshes itself via Ajax automatically in the popup modal. The only problem is that it’s making two extra requests every time an “Add to cart” button is clicked. It slows the site down and doesn’t seem to do anything.
I use Avada theme but I’ve tried Twenty Sixteen and the same thing happens. I’ve also used the auto-generated shop page and the same two extra requests are made if the cart shortcode is added to the shop page. Here’s the site.
I’d really appreciate some help with this problem.