In product listing grid/list view mode after added product to cart with ajax,
Need add custom class in button (Add To Cart) .
Can i create some observer js or i must rewrite standard methods ?
addtocartajaxmagento2
In product listing grid/list view mode after added product to cart with ajax,
Need add custom class in button (Add To Cart) .
Can i create some observer js or i must rewrite standard methods ?
Best Answer
You have to override default catalog-add-to-cart.js file from
vendor/magento/module-catalog/view/frontend/web/js/add-to-cart.js
into your custom theme,
Add one line in below function, addToCartButton.addClass('customclass');
You can replace
customclass
with your own class.