- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Change Add to Cart wording in website and widgets
Hello.
Magento 2.4.2-p1, Porto Theme.
I have changed the wording 'Add to Cart' to 'Add to Basket' throughout my site using the Magento inline translation tool. However, the wording appears to be hardcoded in some places. I need to change the wording in the button on the 'Recently Viewed Products' widget I have created. Does anyone know how to do this please?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Change Add to Cart wording in website and widgets
200+ Magento 2 Extensions for Enhanced Shopping Experience.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Change Add to Cart wording in website and widgets
Unfortunately this did not work.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Change Add to Cart wording in website and widgets
Override your grid.phtml file in your theme
app/design/frontend/VendorName/ThemeName/Magento_CatalogWidget/templates/product/widget/content/grid.phtml
and change from
<button type="submit" title="<?= $block->escapeHtml(__('Add to Cart')) ?>" class="action tocart primary"> <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> </button>
with your condition to
<button type="submit" title="<?= $block->escapeHtml(__('Add to Bag')) ?>" class="action tocart primary"> <span><?= $block->escapeHtml(__('Add to Bag')) ?></span> </button>
See more documents: How To Create Custom Widgets
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Change Add to Cart wording in website and widgets
Hello. Attempted that method, and that also fails!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Change Add to Cart wording in website and widgets
Hi,
Did you mange to solve this?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Change Add to Cart wording in website and widgets
Nope. Could not work out where the wording is located that is used in widgets. Have managed to change it in most places using template path hints but that does not work in the Recently Viewed Products widget.