I think "Add to Cart" button recently viewed is hard coded. Can anyone confirm this?

I did find a guide about changing the words in app/design/frontend/VendorName/ThemeName/Magento_CatalogWidget/templates/product/widget/content/grid.phtml but the codes he is referring to does not match what i have.

  • Hi there , so you want to change the add-to-cart button text only for recently viewed widget , is that your whole requirement or is it okay if that text changes in all places wherever the add-to-cart button shows ? Sep 28, 2022 at 9:52
  • I want all Add to cart buttons to be changed to a Norwegian word, I have manage to translate all other buttons except the one for the recently viewed widget. Sep 28, 2022 at 14:15

1 Answer 1


The add to cart button for the Recently Viewed Widget on magento 2 (from version 2.2 to the latest version 2.4.5) is now set to "Add To Cart" instead of "Add to Cart". I think this is a mistake, I'll create an issue for that and create a pull request to fix that.

So, you have to add a translated record for "Add To Cart":

"Add To Cart","Norwegian"

  • I can confirm that this worked, thank you so much! Sep 30, 2022 at 8:28
  • I don't know if I need to create another ticket for this, but how do I translate the "cancel" button when you remove an item from minicart? Sep 30, 2022 at 8:42
  • @Jan-petterHavna you can translate that "Cancel" button like all other words: "Cancel","TranslatedWord"
    – Tu Van
    Sep 30, 2022 at 11:31
  • I tried this, but it did not work :S I will make another ticket for it. Thanks Sep 30, 2022 at 11:50
  • @Jan-petterHavna I've tested and it works. Make sure your translated words are case-sensitive: "Cancel" instead of "cancel". If you can't make it works, in another ticket, please describe what you tried to translate this text, I'll help.
    – Tu Van
    Sep 30, 2022 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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