Add to Cart Button Not Translating on Submission – Magento Solution

addtocart

The "Add to Cart" Button text is not translating correctly after the product has been added to the cart. Please see below for screenshots of the issue.

On product page load, the translation for the "Add to Cart" is working as expected and button is translated to "Add to Basket" as shown in the image below.

The Product goes through the process of being added to the cart as expected, but when the add to cart process is completed the "Add to Cart" button shows the default string rather than the translation as show in the image below.

How can i fix it, thank you!

Best Answer

You should override catalog-add-to-cart.js file in your theme.

create app/design/frontend/[vendor]/[theme]/Magento_Catalog/web/js/catalog-add-to-cart.js file.

Find:

var addToCartButtonTextDefault = self.options.addToCartButtonTextDefault || $t('Add to Cart');

Replace it to:

var addToCartButtonTextDefault = self.options.addToCartButtonTextDefault || $t('Add to Basket');
Related Topic