How to add a placeholder to the field using a layout processor?

$jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
                ['payment']['children']['payments-list']['children'][$key]['children']['form-fields']['children']
                ['street']= [
                    'component' => 'Magento_Ui/js/form/components/group',
                    'label' => __('Street Address'), // You can change main label from here
                    'required' => true, //turn false if you can removed main label
                    'dataScope' => 'shippingAddress.street.0',
                    'provider' => 'checkoutProvider',
                    'sortOrder' => 1605, // You can set short order of street fields from other checkout fields
                    'type' => 'group',
                    'additionalClasses' => 'street',
                    'children' => [
                        [
                            'label' => __('Street Address'), // Here I can set Label "Adresa" as per above image
                            'component' => 'Magento_Ui/js/form/element/abstract',
                            'config' => [
                                'customScope' => 'shippingAddress',
                                'template' => 'ui/form/field',
                                'elementTmpl' => 'ui/form/element/input'
                            ],
                            'provider' => 'checkoutProvider',
                            'validation' => ['required-entry' => true, "min_text_length" => 1], // You can also set "max_text_length"=> 255 in validation
                        ]
                    ]
                ];
            }

We can also give sort order using this way.

Leave a comment

Your email address will not be published. Required fields are marked *