cancel
Showing results for 
Search instead for 
Did you mean: 

Make VAT ID a required field for guest orders

Highlighted

Make VAT ID a required field for guest orders

Hey guys,

i'm currently stuck on making the vat id a required field for guest orders (shipping address and - if it differs - billing address).

This doesn't seem to be a configuration option ("show in frontend" only can be "yes" or "no" and not "required") and overriding "/vendor/magento/module-customer/view/base/ui_component/customer_form.xml" with

<field name="vat_id" formElement="input">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="source" xsi:type="string">address</item>
        </item>
    </argument>
    <settings>
        <validation>
            <rule name="required-entry" xsi:type="boolean">true</rule>
        </validation>
        <dataType>text</dataType>
    </settings>
</field>

unfortunately didn't work either (if this is the intended way i might have done it wrong).

 

Any help is very appreciated!

 

Thank you

Johannes

1 REPLY
Magento
Software Development

Re: Make VAT ID a required field for guest orders

Hi @Farbenkollektiv

 

okay  -  i understand - i have researched on the functionality you are asking and looks like some one did same kind of functionality previously !!

 

below i am sharing few links which might help you to achieve this kind of functionality !!

 

https://magento.stackexchange.com/questions/37689/make-tax-vat-number-field-required-for-orders-more...

 

https://magento.stackexchange.com/questions/220922/magento-2-checkout-how-to-make-vat-number-require...

 

This is for reference  - https://docs.magento.com/m2/ce/user_guide/tax/vat-validation-configure.html

if issue solved,Click Kudos & Accept as Solution