how can i add notice or lable in checkout page below the state field just like notice below the email address in blow image,

state input element is created by region_id field in vendor\magento\module-checkout\view\frontend\layout\checkout_index_index.xml

<item name="customEntry" xsi:type="string">shippingAddress.region</item>

enter image description here

1 Answer 1


1.Create a di.xml under 'etc' directory of your any custom module

<?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="rewrite-checkout-fields" type="Namespace\Module\Model\Checkout\LayoutProcessorPlugin" sortOrder="10"/>

2.Create a file called LayoutProcessorPlugin.php file under 'Namespace/Module/Model/Checkout'.

namespace Namespace\Module\Model\Checkout;

class LayoutProcessorPlugin
     * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
     * @param array $jsLayout
     * @return array

    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array  $jsLayout
    ) {
            ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['firstname']['notice'] = __('Please enter first name here'); 
            ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['lastname']['notice'] = __('Please enter last name here'); 
        return $jsLayout;

Note: here i add comment below first and last name you can do for others too.Please accept and vote if use full to you this will help others too.enter image description here

  • Please vote as well if acceptable will help to others. Commented Aug 29, 2018 at 10:21
  • Thankyou it work for me, but it is not working with state/province field and i need this for that field only
    – Hiren
    Commented Aug 29, 2018 at 11:39
  • I checked just now it is coming also on state/provice use this: $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step'] ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['region_id']['notice'] = __('Please choose Province'); Commented Aug 29, 2018 at 11:51
  • actually in my case it is coming dynamically where State is Required
    – Hiren
    Commented Aug 29, 2018 at 11:56
  • ok but it should work for all because it takes name element from field and add notice on that below the particular field. Commented Aug 29, 2018 at 11:57

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.