cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Add to cart text and link

SOLVED

Changing Add to cart text and link

Hi,

seeking help on changing add to cart text and link.

I already tried to modify addtocart.phtml (made a copy on my custom theme to edit)

ran setup:upgrade , cache:clean

but it didnt change the text.

 

Any help would be appreciated, Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Changing Add to cart text and link

Hello @gerald_cruz1 

 

Method 1:

Override js file from path

vendor/magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js  

to

app/design/frontend/YourTheme/Packadge/Magento_Catalog/web/js/catalog-add-to-cart.js

Change the text which you want to from this file.

 

Method 2:

 

The shortest way is to enable translate inline and change the add to cart button text.

 

Add to cart button type is "submit" so you can enable template hint path in Configuration -> Developer -> Debug -> Enable Template Path Hints for Storefront and change the form action in which file call add to cart button.

 

You can refer https://meetanshi.com/blog/enable-template-path-hints-in-magento-2/ 

 

Hope one of the above methods is helpful.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

View solution in original post

2 REPLIES 2

Re: Changing Add to cart text and link

Hello @gerald_cruz1 

 

Method 1:

Override js file from path

vendor/magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js  

to

app/design/frontend/YourTheme/Packadge/Magento_Catalog/web/js/catalog-add-to-cart.js

Change the text which you want to from this file.

 

Method 2:

 

The shortest way is to enable translate inline and change the add to cart button text.

 

Add to cart button type is "submit" so you can enable template hint path in Configuration -> Developer -> Debug -> Enable Template Path Hints for Storefront and change the form action in which file call add to cart button.

 

You can refer https://meetanshi.com/blog/enable-template-path-hints-in-magento-2/ 

 

Hope one of the above methods is helpful.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

Re: Changing Add to cart text and link

Hi sir @Meetanshi! this worked for me! thank you so much!