0

I have been trying to change Go to Checkout text to Checkout in mini cart in Magento 2.
I have new theme applied and placed override file as follows:

 app/design/frontend/Darkmage/newtheme/Magento_Checkout/web/template/content.html

Whatever I change the texts (only) like Go to Checkout, View and edit cart, it is not reflecting in minicart, though i clean, flush cache.

1

4 Answers 4

0

Your file location is wrong. Instead of mentioned path, use below path

app/design/frontend/Darkmage/newtheme/Magento_Checkout/web/template/minicart/content.html

You forgot minicart directory.

Clear cache of Magento and clear cache of browser. After clearing cache, your minicart will be updated.

0

Strings added in .phtml templates that are wrapped up in the __('<string>') method can be translated using .csv file. This is better practise and would recommend using this method rather than editing the string directly in the .phtml template file.

You can use the i18n (internationalization) tool to generate the en_US dictionary for your custom theme. Run following command:

php bin/magento i18n:collect-phrases --output="app/design/frontend/CustomVendor/CustomTheme/i18n/en_US.csv" app/design/frontend/CustomVendor/CustomTheme

Now, open the newly generated app/design/frontend/CustomVendor/CustomTheme/i18n/en_US.csv file and add your translation in following format:

"OriginalText1", "Translation1"

"OriginalText2", "Translation2"

"OriginalText3", "Translation3"

Now you need to run the deploy command to get changes of localization: Use following command:

php bin/magento setup:static-content:deploy
0

Please check with below path -

app/design/frontend/Themename/core/i18n/en_US.csv

check with "GO TO CHECKOUT","GO TO CHECKOUT"

0

Step 1: Override the Minicart Template In To Your Theme

  1. Copy the original content.html file from the following path:

vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html

  1. Paste it into your theme directory:

app/design/frontend/MyAgency/MyTheme/Magento_Checkout/web/template/minicart/content.html

Step 2: Edit the content.html File

Replace below code

<button type="button"
    class="action primary checkout"
    data-bind="click: proceedToCheckout, attr: { title: $t('Go to Checkout') }">
    <span data-bind="i18n: 'Go to Checkout'"></span>
</button>

With this code

<button type="button"
    class="action primary checkout"
    data-bind="click: proceedToCheckout, attr: { title: $t('Checkout') }">
    <span data-bind="i18n: 'Checkout'"></span>
</button>

Step 3: Run all magento command for deploy

php bin/magento s:s:d -f
php bin/magento c:f

Alternative Way

Step 1: Create or edit the en_US.csv or any other language file in your theme:

app/design/frontend/MyAgency/MyTheme/i18n/en_US.csv

Step 2: Add the following line to change the text:

"Go to Checkout","Checkout"

Step 3: Run all magento command for deploy

php bin/magento s:s:d -f
php bin/magento c:f

Your Answer

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

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