1

I was trying to change the Checkout page shipping address fields label but I can't find the files where I can change them.

I have checked all the files of shipping address files but I am unable to change the Label text.

Please Magento 2.x default checkout shipping address fields label and also check my desire text label for shipping address.

Is there anyone to help me out.

Please check my screenshots below. 1. Magento 2.x Default Checkout page url: https://cloud.githubusercontent.com/assets/22374102/25710262/92983352-310d-11e7-8676-6c333a13e6f8.png

  1. Custom Checkout screenshot url link: https://cloud.githubusercontent.com/assets/22374102/25710264/92d236ec-310d-11e7-9a3e-fe82416e7041.png
  • Did you tried using translation? Or you want to change hard code? – Sohel Rana May 5 '17 at 9:30
  • I have tried with Translate but it's not working – Shakib Rahman May 5 '17 at 10:14
1

You can easily change label text using translation. You can follow official tutorial

Now I am going to create a module called SR_Checkout. So make sure this module is load after Magento_Checkout module. So module.xml looks like


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="SR_Checkout" setup_version="2.0.0">
        <sequence>
            <module name="Magento_Checkout"/>
        </sequence>
    </module>
</config>

Now create a i18n directory under your module path is SR/Checkout/i18n

Create SR/Checkout/i18n/en_US.csv and content should be


City,Test City
Country,Test Country
State/Province,Test State/Province

OR

You can overwrite in theme level translation. Here is an example

So go to your theme, open app/design/frontend/YourVendor/YourTheme/i18n/en_US.csv and put following content


"City","Test1 City"
"Country","Test1 Country"
"State/Province","Test1 State/Province"

Clear cache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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