Shakib Rahman
Shakib Rahman

Reputation: 29

Checkout page shipping Address form edit Magento2

I need help for Magento 2.x shipping Address fields.

I want to change the Address label text using my new Label text.

Is there anyone you who have changed the Address Label text by own Lable Text. Could anyone please give the file path and where I can change the text for Checkout page Shipping address fields.

Please Take a look my screenshot below.

enter image description here

Upvotes: 2

Views: 9342

Answers (2)

Arunprabakaran M
Arunprabakaran M

Reputation: 129

Following will be helpful

step 1 : If you want to change the shipping address fields as well as billing address fields, You can do via theme transaction if you have made a custom theme as per your language.

i.e: en_US

Step 2 : If you change made in shipping address fields only, Please override LayoutProcessor.php

step 2.1

di.xml

path: app/code/vendor/module_name/etc

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
        <plugin name="Custom_Checkout" type="vendor\module_name\Block\LayoutProcessor" sortOrder="100"/>
    </type> 
</config>

Step 2: LayoutProcessor.php

path:app/code/vendor/module_name/Block/

         public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array  $jsLayout
    ) {
        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
            ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['lastname']['label'] = __('Recipient lastname'); 

            $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
            ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['region_id']['label'] = __('Division'); 

        return $jsLayout;
    }
}

It's work like charm

Upvotes: 1

Varma
Varma

Reputation: 95

Here is the path where you can edit Address label text:

app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml

Upvotes: 3

Related Questions