I want to force taxvat field as not required on customer create form Even if i have ovrride


with a plugin in my custom module

<div class="field taxvat">
<label class="label" for="<?= $block->escapeHtmlAttr($block->getFieldId('taxvat')) ?>"><span><?= $block->escapeHtml($block->getStoreLabel('taxvat')) ?></span></label>
<div class="control">
    <input type="text" id="<?= $block->escapeHtmlAttr($block->getFieldId('taxvat')) ?>" name="<?= $block->escapeHtmlAttr($block->getFieldName('taxvat')) ?>" value="<?= $block->escapeHtmlAttr($block->getTaxvat()) ?>" title="<?= $block->escapeHtmlAttr($block->getStoreLabel('taxvat')) ?>" class="input-text ">

removing data-validate="{required:true}"

when i submit form it get me error "Tax/VAT Number" is a required value.

enter image description here


That should be manageable from admin. Location:

Stores -> Configuration -> Customer -> Customer Configuration -> Name and Address Options

enter image description here

  • yes off course but i need a programmatically way :( – Altravista Nov 30 '19 at 10:17

solution is to override validateValue function in class


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.