Skip to main content
edited tags
Link
sv3n
  • 11.7k
  • 7
  • 41
  • 73
Grammar and spelling amendments.
Source Link

Validate Adding validation to shipping field on the checkout fields

I am editing this file

RootFolder\vendor\magento\module-checkout\view\frontend\layout\checkout_index_index

RootFolder\vendor\magento\module-checkout\view\frontend\layout\checkout_index_index

toTo add new validations to the checkout.

For fields like "telephone"telephone I just need to edit it like this:

<item name="telephone" xsi:type="array"> 
<item name="config" xsi:type="array"> 
<item name="tooltip" xsi:type="array"> 
<item name="description" xsi:type="string" translate="true">For delivery questions.</item> </item> </item> 

<!-- Validation starts --> 
<item name="validation" xsi:type="array"> 
<item name="validate-email" xsi:type="boolean">true</item> </item>
 <!-- Validation ends -->
 </item>

But I can't find where to add a validation to one of the address fields

enter image description here

Does somebody know how to add a validation to one of the address fields?

Validate checkout fields

I am editing this file

RootFolder\vendor\magento\module-checkout\view\frontend\layout\checkout_index_index

to add new validations to the checkout.

For fields like "telephone" I just need to edit it like this:

<item name="telephone" xsi:type="array"> 
<item name="config" xsi:type="array"> 
<item name="tooltip" xsi:type="array"> 
<item name="description" xsi:type="string" translate="true">For delivery questions.</item> </item> </item> 

<!-- Validation starts --> 
<item name="validation" xsi:type="array"> 
<item name="validate-email" xsi:type="boolean">true</item> </item>
 <!-- Validation ends -->
 </item>

But I can't find where to add a validation to one of the address fields

enter image description here

Does somebody how to add a validation to one of the address fields?

Adding validation to shipping field on the checkout

I am editing this file

RootFolder\vendor\magento\module-checkout\view\frontend\layout\checkout_index_index

To add new validations to the checkout.

For fields like telephone I just need to edit it like this:

<item name="telephone" xsi:type="array"> 
<item name="config" xsi:type="array"> 
<item name="tooltip" xsi:type="array"> 
<item name="description" xsi:type="string" translate="true">For delivery questions.</item> </item> </item> 

<!-- Validation starts --> 
<item name="validation" xsi:type="array"> 
<item name="validate-email" xsi:type="boolean">true</item> </item>
 <!-- Validation ends -->
 </item>

But I can't find where to add a validation to one of the address fields

enter image description here

Does somebody know how to add a validation to one of the address fields?

Source Link

Validate checkout fields

I am editing this file

RootFolder\vendor\magento\module-checkout\view\frontend\layout\checkout_index_index

to add new validations to the checkout.

For fields like "telephone" I just need to edit it like this:

<item name="telephone" xsi:type="array"> 
<item name="config" xsi:type="array"> 
<item name="tooltip" xsi:type="array"> 
<item name="description" xsi:type="string" translate="true">For delivery questions.</item> </item> </item> 

<!-- Validation starts --> 
<item name="validation" xsi:type="array"> 
<item name="validate-email" xsi:type="boolean">true</item> </item>
 <!-- Validation ends -->
 </item>

But I can't find where to add a validation to one of the address fields

enter image description here

Does somebody how to add a validation to one of the address fields?