- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2021
02:25 AM
04-19-2021
02:25 AM
How to enable ajax for add-to-cart button and wishlist button of product widgets on home page?
I have added products on the homepage using the widget, how to enable ajax for add-to-cart button and wishlist button of product widgets.
Labels:
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2021
03:31 AM
05-16-2021
03:31 AM
Re: How to enable ajax for add-to-cart button and wishlist button of product widgets on home page?
Hi @Aveeva,
You have to override addtocart.phtml file
app/design/frontend/vendorname/themename/Magento_Catalog/templates/product/view/addtocart.phtml
Now just replace "bindSubmit": false to "bindSubmit": true
<script type="text/x-magento-init"> { "#product_addtocart_form": { "catalogAddToCart": { "bindSubmit": false } } } </script>
to
<script type="text/x-magento-init"> { "#product_addtocart_form": { "catalogAddToCart": { "bindSubmit": true } } } </script>
Now delete cache and page_cache folder or flush cache.
Note: Make sure you have to set No from Store -> Configuration -> Sales -> Checkout-> Shopping Cart -> After Adding a Product Redirect to Shopping Cart to No.
Hope this can help you! Let me know if you need further assistance.
________
If issue solved, Click Kudos & Accept as Solution.
LitExtension - #1 Shopping Cart Migration Expert
LitExtension helps store owners and agencies migrate all important data from one eCommerce platform to another accurately, securely and at the highest speed.
Visit website: http://litextension.com/
LitExtension helps store owners and agencies migrate all important data from one eCommerce platform to another accurately, securely and at the highest speed.
Visit website: http://litextension.com/