Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Customize vendor registration fields
Tagged: vendor registration form
- This topic has 9 replies, 3 voices, and was last updated 5 years, 2 months ago by bolon_campana.
- AuthorPosts
- September 26, 2019 at 4:14 am #83643GalloParticipant
Hello, I was trying to cutomize the vendor registration field. First, I found a code in the forums and tried to see if it works for removing address 2 and the zip code (code in comments). But then I wanted to maintain the address 2 and remove state and zip code. Unfortunately, the first change remains, address 2 does not appear and the state is still there. He is the code I used from the site’s forums:
// function wcfm_marketplace_settings_fields_0410_address( $address_fields ) { // if( isset( $address_fields['addr_2'] ) ) { // $address_fields['addr_2']['class'] = 'wcfm_custom_hide'; // $address_fields['addr_2']['label_class'] = 'wcfm_custom_hide'; // } // if( isset( $address_fields['zip'] ) ) { // $address_fields['zip']['class'] = 'wcfm_custom_hide'; // $address_fields['zip']['label_class'] = 'wcfm_custom_hide'; // } // return $address_fields; // } // add_filter( 'wcfm_marketplace_settings_fields_address', 'wcfm_marketplace_settings_fields_0410_address' ); // add_filter( 'wcfm_membership_registration_fields_address', 'wcfm_marketplace_settings_fields_0410_address' ); function wcfm_marketplace_settings_fields_0410_address( $address_fields ) { $address_fields = wcfm_hide_field( 'state', $address_fields ); if( isset( $address_fields['state'] ) ) unset( $address_fields['state'] ); return $address_fields; } add_filter( 'wcfm_marketplace_settings_fields_address', 'wcfm_marketplace_settings_fields_0410_address' ); add_filter( 'wcfm_membership_registration_fields_address', 'wcfm_marketplace_settings_fields_0410_address' );
- September 26, 2019 at 4:14 pm #83785WCFM ForumMember
Hi,
This codes are for some other purpose.
What you want to change in Registration form?
Thank You
- September 26, 2019 at 11:30 pm #83890GalloParticipant
Hi,
I would like to remove “Sate” (Etat/Pays in the French version), make “Zip code” optional, change “City” (“Ville/Localité” in the French verion) to just “Localité”, and chabge “Country” to “Commune” and replace the list of countries in the drop-down menu with my own names. - September 27, 2019 at 3:17 pm #84021WCFM ForumMember
HI,
Please add this to code to your site –
function wcfm_marketplace_address_fields_rearrange( $address_fields ) { if( isset( $address_fields['zip'] ) && isset( $address_fields['zip']['custom_attributes'] ) ) { unset( $address_fields['zip']['custom_attributes'] ); } if( isset( $address_fields['state'] ) ) { $address_fields['state']['label'] = 'Etat/Pays'; } if( isset( $address_fields['city'] ) ) { $address_fields['city']['label'] = 'Localité'; } if( isset( $address_fields['country'] ) ) { $address_fields['country']['label'] = 'Commune'; } return $address_fields; } add_filter( 'wcfm_marketplace_settings_fields_address', 'wcfm_marketplace_address_fields_rearrange' ); add_filter( 'wcfm_membership_registration_fields_address', 'wcfm_marketplace_address_fields_rearrange' ); add_filter( 'wcfm_wcmarketplace_settings_fields_customer_support', 'wcfm_marketplace_address_fields_rearrange' );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Thank You
- September 27, 2019 at 11:37 pm #84118GalloParticipant
Hi,
I am sorry, it is a little different than what I wanted.
Now, I want to remove “Sate” “City” “Country” and make “zip code” optional.
Please could you show me the code for that.Thank you
- September 30, 2019 at 9:11 am #84415WCFM ForumMember
OK, please use this revised code –
function wcfm_marketplace_address_fields_rearrange( $address_fields ) { if( isset( $address_fields['zip'] ) && isset( $address_fields['zip']['custom_attributes'] ) ) { unset( $address_fields['zip']['custom_attributes'] ); } $address_fields = wcfm_hide_field( 'state', $address_fields ); $address_fields = wcfm_hide_field( 'city', $address_fields ); $address_fields = wcfm_hide_field( 'country', $address_fields ); return $address_fields; } add_filter( 'wcfm_marketplace_settings_fields_address', 'wcfm_marketplace_address_fields_rearrange' ); add_filter( 'wcfm_membership_registration_fields_address', 'wcfm_marketplace_address_fields_rearrange' ); add_filter( 'wcfm_wcmarketplace_settings_fields_customer_support', 'wcfm_marketplace_address_fields_rearrange' );
Thank You
- September 30, 2019 at 1:34 pm #84498GalloParticipant
Thank you, that works
- October 2, 2019 at 9:47 am #84738bolon_campanaParticipant
I have an associated question. Do these kind of fixes stay after updating the plugin, or they must be patched with every update. Thanks in advance!
- October 3, 2019 at 10:49 pm #84962WCFM ForumMember
Well, you have to add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Plugin’s update will not hamper this at all.
Thank you
- October 9, 2019 at 11:00 pm #85863bolon_campanaParticipant
Thanks a lot!
- AuthorPosts
- The topic ‘Customize vendor registration fields’ is closed to new replies.