After clicking on add to cart button the button text is not changing to adding or added.In some places its working but in product description page and we have created a featured product widget in home page in both of these places its not working.where i need to change the code for this.
Magento2 Add to Cart – Button Text Not Changing to ‘Adding’ and ‘Added’
addtocartmagento2
Best Answer
The main file is responsible to change label
Adding...
andAdded
isMagento\Catalog\view\frontend\web\js\catalog-add-to-cart.js
When you click on
Add to Cart
button It execute thesubmitForm
function from this file,And after that It execute the
self.ajaxSubmit(form)
funciton from the same file,on this function you can see the line
this line is responsible for to change label
Adding..
and after that on Ajax success function It calls the
self.enableAddToCartButton(form);
this function changes the label toAdded
So just debug this file and location to check your Issue. Also, check console to see any error.