Guest User

Untitled

a guest
Aug 17th, 2019
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <item name="custom-checkout-form" xsi:type="array">
  2. <item name="component" xsi:type="string">uiComponent</item>
  3. <item name="displayArea" xsi:type="string">custom-checkout-form</item>
  4. <item name="children" xsi:type="array">
  5. <item name="custom-checkout-form-container" xsi:type="array">
  6. <item name="sortOrder" xsi:type="string">0</item>
  7. <item name="component" xsi:type="string">Vendor_Module/js/view/checkout/custom-checkout-form</item>
  8. <item name="provider" xsi:type="string">checkoutProvider</item>
  9. <item name="config" xsi:type="array">
  10. <item name="template" xsi:type="string">Vendor_Module/checkout/custom-checkout-form</item>
  11. </item>
  12. <item name="children" xsi:type="array">
  13. <item name="custom-checkout-form-fieldset" xsi:type="array">
  14. <item name="component" xsi:type="string">uiComponent</item>
  15. <item name="displayArea" xsi:type="string">custom-checkout-form-fields</item>
  16. <item name="children" xsi:type="array">
  17. <item name="checkout_buyer_name" xsi:type="array">
  18. <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
  19. <item name="config" xsi:type="array">
  20. <item name="customScope" xsi:type="string">customCheckoutForm</item>
  21. <item name="template" xsi:type="string">ui/form/field</item>
  22. <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
  23. </item>
  24. <item name="provider" xsi:type="string">checkoutProvider</item>
  25. <item name="dataScope" xsi:type="string">customCheckoutForm.checkout_buyer_name</item>
  26. <item name="label" xsi:type="string">Buyer name</item>
  27. <item name="sortOrder" xsi:type="string">1</item>
  28. </item>
  29. <item name="checkout_buyer_email" xsi:type="array">
  30. <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
  31. <item name="config" xsi:type="array">
  32. <item name="customScope" xsi:type="string">customCheckoutForm</item>
  33. <item name="template" xsi:type="string">ui/form/field</item>
  34. <item name="elementTmpl" xsi:type="string">ui/form/element/email</item>
  35. <item name="tooltip" xsi:type="array">
  36. <item name="description" xsi:type="string" translate="true">We will send an order confirmation to this email address</item>
  37. </item>
  38. </item>
  39. <item name="provider" xsi:type="string">checkoutProvider</item>
  40. <item name="dataScope" xsi:type="string">customCheckoutForm.checkout_buyer_email</item>
  41. <item name="label" xsi:type="string">Buyer email</item>
  42. <item name="sortOrder" xsi:type="string">2</item>
  43. <item name="validation" xsi:type="array">
  44. <item name="validate-email" xsi:type="boolean">true</item>
  45. </item>
  46. </item>
  47. <item name="checkout_purchase_order_no" xsi:type="array">
  48. <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
  49. <item name="config" xsi:type="array">
  50. <item name="customScope" xsi:type="string">customCheckoutForm</item>
  51. <item name="template" xsi:type="string">ui/form/field</item>
  52. <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
  53. </item>
  54. <item name="validation" xsi:type="array">
  55. <item name="required-entry" xsi:type="boolean">true</item>
  56. </item>
  57. <item name="provider" xsi:type="string">checkoutProvider</item>
  58. <item name="dataScope" xsi:type="string">customCheckoutForm.checkout_purchase_order_no</item>
  59. <item name="label" xsi:type="string">Purchase order no.</item>
  60. <item name="sortOrder" xsi:type="string">3</item>
  61. </item>
  62. <item name="checkout_goods_mark" xsi:type="array">
  63. <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
  64. <item name="config" xsi:type="array">
  65. <item name="customScope" xsi:type="string">customCheckoutForm</item>
  66. <item name="template" xsi:type="string">ui/form/field</item>
  67. <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
  68. </item>
  69. <item name="provider" xsi:type="string">checkoutProvider</item>
  70. <item name="dataScope" xsi:type="string">customCheckoutForm.checkout_goods_mark</item>
  71. <item name="label" xsi:type="string">Goods mark</item>
  72. <item name="sortOrder" xsi:type="string">4</item>
  73. </item>
  74.  
  75.  
  76.  
  77. <item name="checkout_building_address" xsi:type="array">
  78. <item name="component" xsi:type="string">Magento_Ui/js/form/element/select</item>
  79. <item name="config" xsi:type="array">
  80. <!--customScope is used to group elements within a single form (e.g. they can be validated separately)-->
  81. <item name="customScope" xsi:type="string">customCheckoutForm</item>
  82. <item name="template" xsi:type="string">ui/form/field</item>
  83. <item name="elementTmpl" xsi:type="string">ui/form/element/select</item>
  84. </item>
  85.  
  86.  
  87. <item name="options" xsi:type="object">VendorModuleModelOptionsOptions</item>
  88.  
  89.  
  90. <!-- value element allows to specify default value of the form field -->
  91. <item name="value" xsi:type="string">Please Select Value</item>
  92. <item name="provider" xsi:type="string">checkoutProvider</item>
  93. <item name="dataScope" xsi:type="string">customCheckoutForm.checkout_building_address</item>
  94. <item name="label" xsi:type="string">Select Building Address</item>
  95. <item name="sortOrder" xsi:type="string">2</item>
  96. </item>
  97.  
  98.  
  99.  
  100. <item name="checkout_comment" xsi:type="array">
  101. <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
  102. <item name="config" xsi:type="array">
  103. <item name="customScope" xsi:type="string">customCheckoutForm</item>
  104. <item name="template" xsi:type="string">ui/form/field</item>
  105. <item name="elementTmpl" xsi:type="string">ui/form/element/textarea</item>
  106. <item name="cols" xsi:type="string">15</item>
  107. <item name="rows" xsi:type="string">2</item>
  108. </item>
  109. <item name="provider" xsi:type="string">checkoutProvider</item>
  110. <item name="dataScope" xsi:type="string">customCheckoutForm.checkout_comment</item>
  111. <item name="label" xsi:type="string">Comment</item>
  112. <item name="sortOrder" xsi:type="string">5</item>
  113. </item>
  114. </item>
  115. </item>
  116. </item>
  117. </item>
  118. </item>
  119. </item>
  120. </item>
  121.  
  122. namespace VendorModuleModelOptions;
  123.  
  124. use MagentoFrameworkDataOptionSourceInterface;
  125. use MagentoFrameworkViewElementBlockArgumentInterface;
  126.  
  127. class Options implements OptionSourceInterface, ArgumentInterface
  128. {
  129. /**
  130. * @return array
  131. */
  132. public function toOptionArray()
  133. {
  134. $options = [
  135. [
  136. 'value' => '1',
  137. 'label' => 'Option 1'
  138. ],
  139. [
  140. 'value' => '2',
  141. 'label' => 'Option 2'
  142. ],
  143. [
  144. 'value' => '3',
  145. 'label' => 'Option 3'
  146. ],
  147. [
  148. 'value' => '4',
  149. 'label' => 'Option 4'
  150. ]
  151. ];
  152.  
  153. return $options;
  154. }
  155. }
RAW Paste Data