How to remove the VAT / SSN field on the registration form
Many users complain that in their VAT / SSN country you do not need and want to remove it. I have to remove it first thing disable the VAT as required field. This is going to be Yith Plugi ns -> Multi Vendor -> Frontpage. Under Vendor registration page are an option to disable the VAT as required field, see this screenshot:
Did this the more experienced can overwrite the template from the theme. Just copy the file that is under templates / shortcodes / become-a-vendor.php and copy it in the theme folder under woocommerce / shortcodes. After that it opens the file and go to delete the lines of code related to the input of VAT / SSN. In the current version, 1.9.13, deletion lines are from 48 to 52 and this is related to those lines Code:
<p class="form-row form-row-wide">
<?php $vat_field_required = $is_vat_require ? '*' : ''; ?>
<label for="vendor-vat"><?php echo __( 'VAT/SSN', 'yith_wc_product_vendors' ) . ' ' . $vat_field_required ?></label>
<input type="text" class="input-text <?php echo $is_vat_require ? 'yith-required' : '' ?>" name="vendor-vat" id="vendor-vat" value="<?php echo $vat ?>">
</p>
For those not very familiar with child themes and overwriting template you can just copy this code in the functions.php file of your theme:
if( function_exists( 'YITH_Vendors' ) ){
add_action( 'wp_enqueue_scripts', 'yith_wcmv_inline_js', 20 );
function yith_wcmv_inline_js(){
if( is_page( wc_get_page_id( 'myaccount' ) ) || is_page( get_option( 'yith_wpv_become_a_vendor_page_id', 0 ) ) ){
$js = "jQuery('#vendor-vat').parent('p.form-row').remove();";
wp_add_inline_script( 'product-vendors', $js );
}
}
}