Estás leyendo la publicación: Cómo agregar una etiqueta en todas las líneas en la dirección de la calle en la página de pago de Magento 2
espacio de nombres Proveedor\Nombre del módulo\Complemento\Pago;
clase LayoutProcessorPlugin
{
función pública afterProcess(
\Magento\Checkout\Block\Checkout\LayoutProcessor $asunto,
arreglo $jsLayout
)
{
$jsLayout[‘components’][‘checkout’][‘children’][‘steps’][‘children’][‘shipping-step’][‘children’]
[‘shippingAddress’][‘children’][‘shipping-address-fieldset’][‘children’][‘street’] = [
‘component’ => ‘Magento_Ui/js/form/components/group’,
‘label’ => __(‘Address Label’), //sreet address main label
‘required’ => false, // set false if removed sreet address label
‘dataScope’ => ‘shippingAddress.street’,
‘provider’ => ‘checkoutProvider’,
‘sortOrder’ => 0,
‘type’ => ‘group’,
‘additionalClasses’ => ‘street’,
‘children’ => [ // here add children as per your requirement
[
‘label’ => __(‘Address Label 1’),
‘component’ => ‘Magento_Ui/js/form/element/abstract’,
‘config’ => [
‘customScope’ => ‘shippingAddress’,
‘template’ => ‘ui/form/field’,
‘elementTmpl’ => ‘ui/form/element/input’
],
‘ámbito de datos’ => ‘0’,
‘proveedor’ => ‘proveedor de pago’,
‘validación’ => [‘required-entry’ => true, “min_text_length” => 1, “max_text_length” => 255],
],
[
‘label’ => __(‘Address Label 2’),
‘component’ => ‘Magento_Ui/js/form/element/abstract’,
‘config’ => [
‘customScope’ => ‘shippingAddress’,
‘template’ => ‘ui/form/field’,
‘elementTmpl’ => ‘ui/form/element/input’
],
‘ámbito de datos’ => ‘1’,
‘proveedor’ => ‘proveedor de pago’,
‘validación’ => [‘required-entry’ => true, “min_text_length” => 1, “max_text_length” => 255],
],
[
‘label’ => __(‘Address Label 3’),
‘component’ => ‘Magento_Ui/js/form/element/abstract’,
‘config’ => [
‘customScope’ => ‘shippingAddress’,
‘template’ => ‘ui/form/field’,
‘elementTmpl’ => ‘ui/form/element/input’
],
‘ámbito de datos’ => ‘2’,
‘proveedor’ => ‘proveedor de pago’,
‘validación’ => [‘required-entry’ => true, “min_text_length” => 1, “max_text_length” => 255],
],
]
];
devolver $jsLayout;
}
}