X
    Categories: Knowledgebase

[Solved] add product in cart using ajax in Magento 2

If you want to add product in minicart Magento 2 with Ajax, follow below way:
– Open addtocart.phtml file in your theme directory:
app/design/frontend///Magento_Catalog/templates/product/view
– Modify the bindSubmit function

		{
			"#product_addtocart_form": {
				"catalogAddToCart": {
					"bindSubmit": true
				}
			}
		}
Leo: