How to change checkout page label state/province to Delivery location anyone help me
2 Answers
I have assume that your magento version 2. So check below answer.
Translation for State/Province and Zip/Postal Code is found (by default) in /vendor/magento/module-checkout/i18n directory.
You can copy locale's csv file from /vendor/magento/module-checkout/i18n folder to app/code/Magento/module-checkout/i18n directory.
Then find the text and change its translation.
After saving file, don't forget to remove content from /var/cache folder and /var/page_cache folder
You can use this below way :
Create di.xml file at app/code/Vendor/Module/etc/frontend/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="checkout_lbl_change" type="Vendor\Module\Plugin\LayoutProcessor" sortOrder="1"/>
</type>
</config>
Create LayoutProcessor.php file at app/code/Vendor/Module/Plugin/LayoutProcessor.php
:
<?php
namespace Vendor\Module\Plugin;
class LayoutProcessor
{
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']['region_id']['label'] = __('Delivery location');
return $jsLayout;
}
}
Output :
-
-
-
-
-
Yes. Plugin work in all version. Maybe it's theme related issue. Not sure. Commented Mar 18, 2020 at 12:51