Advertisement
Guest User

Untitled

a guest
Dec 7th, 2021
1,120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. namespace/module/Model/Checkout/LayoutProcessorPlugin
  2.  
  3. ...
  4.  
  5. <?php
  6.  
  7. namespace Namespace\Module\Model\Checkout;
  8.  
  9. class LayoutProcessorPlugin
  10. {
  11. /**
  12. * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
  13. * @param array $jsLayout
  14. * @return array
  15. */
  16.  
  17. public function afterProcess(
  18. \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
  19. array $jsLayout
  20. ) {
  21. $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
  22. ['shippingAddress']['children']['shipping-address-fieldset']['children']['street'] = [
  23. 'component' => 'Magento_Ui/js/form/components/group',
  24. 'label' => __('Street Address'),
  25. 'required' => true,
  26. 'dataScope' => 'shippingAddress.street',
  27. 'provider' => 'checkoutProvider',
  28. 'sortOrder' => 60,
  29. 'type' => 'group',
  30. 'additionalClasses' => 'street',
  31. 'children' => [
  32. [
  33. 'component' => 'Magento_Ui/js/form/element/abstract',
  34. 'config' => [
  35. 'customScope' => 'shippingAddress',
  36. 'template' => 'ui/form/field',
  37. 'elementTmpl' => 'ui/form/element/input'
  38. ],
  39. 'dataScope' => '0',
  40. 'provider' => 'checkoutProvider',
  41. 'validation' => ['required-entry' => true, "min_text_len‌​gth" => 1, "max_text_length" => 255],
  42. ],
  43. [
  44. 'component' => 'Magento_Ui/js/form/element/abstract',
  45. 'config' => [
  46. 'customScope' => 'shippingAddress',
  47. 'template' => 'ui/form/field',
  48. 'elementTmpl' => 'ui/form/element/input'
  49. ],
  50. 'dataScope' => '1',
  51. 'provider' => 'checkoutProvider',
  52. 'validation' => ['required-entry' => false, "min_text_len‌​gth" => 1, "max_text_length" => 255],
  53. ]
  54. ]
  55. ];
  56. return $jsLayout;
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement