Multivendor - Add new fields to the vendor registration

You can add a new fileds to vendor registration in this way:

 

in wp-content/plugins/yith-woocommerce-multi-vendor-premium/templates/admin you'll find the file called edit-product-vendors-taxonomy.php. You can copy this file and paste it into wp-content/themes/YOUR_THEME_FOLDER/woocommerce/admin. Once done, the file that will be uploaded is not the plugin file, but the one that you have just pasted into the theme.

To save the new fileds you can use this hook:

$vendor = apply_filters( 'yith_new_vendor_registration_fields', $vendor );

You can set the _name_ field of the input field in the following way: name="yith_vendor_data[CUSTOM_FIELD_NAME]", where CUSTOM_FIELD_NAME is the name of the field you're going to add.

After this you can set the new filed in this way: 

$vendor->CUSTOM_FIELD_NAME = $_POST['yith_vendor_data']['CUSTOM_FIELD_NAME'];

The plugin will save that and will be able to recover it through $vendor->CUSTOM_FIELD_NAME

 If you want to make the vendors be able to edit these fields, you should do the same operation for the file vendor-admin-settings.php that can be found in wp-content/plugins/yith-woocommerce-multi-vendor-premium/templates/admin/vendor-panel and, similarly to what you did before, copy it into wp-content/themes/YOUR_THEME_FOLDER/woocommerce/admin/vendor-panel.
 

Then, if you want to show these fields in the registration, the file that needs to be overriden in the theme (as done before) is become-a-vendor.php. You can find it in wp-content/plugins/yith-woocommerce-multi-vendor-premium/templates/shortcodes and you have to copy it into wp-content/themes/YOUR_THEME_FOLDER/woocommerce/shortcodes.

 

Your theme might also not have the folders woocommerce, admins, shortcodes and vendor-panel, but you could create them. I know it might seem complex, but this could help you do what you need

Was this article helpful?
0 out of 0 found this helpful

Back to Help Center

Powered by Zendesk