Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace/module/Model/Checkout/LayoutProcessorPlugin
- ...
- <?php
- 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
- ) {
- $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
- ['shippingAddress']['children']['shipping-address-fieldset']['children']['street'] = [
- 'component' => 'Magento_Ui/js/form/components/group',
- 'label' => __('Street Address'),
- 'required' => true,
- 'dataScope' => 'shippingAddress.street',
- 'provider' => 'checkoutProvider',
- 'sortOrder' => 60,
- 'type' => 'group',
- 'additionalClasses' => 'street',
- 'children' => [
- [
- 'component' => 'Magento_Ui/js/form/element/abstract',
- 'config' => [
- 'customScope' => 'shippingAddress',
- 'template' => 'ui/form/field',
- 'elementTmpl' => 'ui/form/element/input'
- ],
- 'dataScope' => '0',
- 'provider' => 'checkoutProvider',
- 'validation' => ['required-entry' => true, "min_text_length" => 1, "max_text_length" => 255],
- ],
- [
- 'component' => 'Magento_Ui/js/form/element/abstract',
- 'config' => [
- 'customScope' => 'shippingAddress',
- 'template' => 'ui/form/field',
- 'elementTmpl' => 'ui/form/element/input'
- ],
- 'dataScope' => '1',
- 'provider' => 'checkoutProvider',
- 'validation' => ['required-entry' => false, "min_text_length" => 1, "max_text_length" => 255],
- ]
- ]
- ];
- return $jsLayout;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement