结帐页面发货地址表格编辑Magento2

时间:2017-05-04 13:10:10

标签: checkout magento2

我需要Magento 2.x送货地址字段的帮助。

我想使用新的标签文字更改地址标签文字。

是否有人通过自己的Lable文本更改了地址标签文本。任何人都可以给出文件路径以及我可以在哪里更改Checkout页面送货地址字段的文本。

请看下面的截图。

enter image description here

2 个答案:

答案 0 :(得分:2)

以下是您可以编辑地址标签文字的路径:

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

答案 1 :(得分:0)

以下内容会有所帮助

第1步:       如果要更改收货地址字段和帐单地址字段,如果您已根据语言制作了自定义主题,则可以通过主题交易来完成。

即:en_US

第2步:       如果仅在送货地址字段中进行了更改,请覆盖LayoutProcessor.php

步骤2.1

di.xml

路径:应用程序/代码/供应商/模块名称/等

<?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>

步骤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;
    }
}

就像魅力一样工作

相关问题