0

I'd like to rename the "Add to cart" button to "View now" on the catalog page and homepage only. However on the product view it should still state "Add to cart".

Which js files do I have to edit in order to achieve that?

1
  • for homepage check with file, which is loaded Jul 10 '19 at 10:47
0

For homepage check with which file are you using.

for product list page override js file from path

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

to

app/design/frontend/themename/packagename/Magento_Catalog/web/js/catalog-add-to-cart.js

you can changes text which you want to from this file.

2
  • I don't really understand your solution, could you elaborate? I am not so experienced so a step by step guide would be very useful.
    – warum7
    Jul 11 '19 at 11:12
  • first goto vendor/magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js and copy this file, than paste here - app/design/frontend/yourthemename/yourpackagename/Magento_Catalog/web/js/catalog-add-to-cart.js than find 'Add to Cart' text and than replace. Jul 12 '19 at 5:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.