cancel
Showing results for 
Search instead for 
Did you mean: 

Change Add to Cart wording in website and widgets

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!

4 REPLIES 4

Re: Change Add to Cart wording in website and widgets

@GTLTD  

Please add translated word in particular store language CSV file
from app\design\frontend\Smartwave\porto\i18n\en_US.csv
For example:
Recently Viewed Products, Recently Viewed Items
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: Change Add to Cart wording in website and widgets

Unfortunately this did not work.

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

Re: Change Add to Cart wording in website and widgets

Hello. Attempted that method, and that also fails!