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!
Unfortunately this did not work.
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
Hello. Attempted that method, and that also fails!
Hi,
Did you mange to solve this?
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.