It's hard to imagine the consequences of an inactive add-to-cart button for an e-commerce store. Your customers can't make the purchase, which both reduces revenue and reduces the store experience.
Usually, when the user presses the add to cart button from the homepage, it shows the message stating item has been added to the cart. But actually, the cart shows a refreshed page and is empty. However, the reason for this problem might be due to the cache. So, enable all cache options from Magento Admin Panel to resolve this issue.
You can follow the steps below to fix the "add to cart is not working" issue,
- Firstly, log in to Magento Admin Panel.
- Then, navigate to System > Tools > Cache Management under the Admin Panel sidebar.
- Lastly, In the drop-down list, select Enable and then click Submit to select all caching options.
Magento Add to Cart button not working on the Categories and Product Page:
When a user adds a product to the cart from the categories or product page, they are redirected to the checkout page with an empty cart. It occurs because of the domain change, as Magento stores the root URL in the third path without affecting the first version.
In order to resolve the issue, you can follow the below methods:
- Firstly, run the below additional SQL query:
SET value = REPLACE(value, '<old root URL or domain>', '<new root URL or domain>')
WHERE path = 'design/head/includes';
- Lastly, delete the cache using the following command:
rm -rf var/cache/*
Thus, I hope the above solution helps you to fix the "add to cart is not working and cart is empty" issue.
Magento Hosting | VPS Hosting