wcfm-santa

Making Christmas merrier with our special gift! Enjoy upto 25% off on all WCFM Addons.

CLAIM OFFER
03Day 12Hr 58Min 36Sec

Customize vendor registration fields

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 9 reply threads
  • Author
    Posts
    • #83643
      Gallo
      Participant

      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' );
    • #83785
      WCFM Forum
      Member

      Hi,

      This codes are for some other purpose.

      What you want to change in Registration form?

      Thank You

    • #83890
      Gallo
      Participant

      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.

    • #84021
      WCFM Forum
      Member

      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

    • #84118
      Gallo
      Participant

      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

    • #84415
      WCFM Forum
      Member

      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

    • #84498
      Gallo
      Participant

      Thank you, that works

    • #84738
      bolon_campana
      Participant

      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!

    • #84962
      WCFM Forum
      Member

      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

    • #85863
      bolon_campana
      Participant

      Thanks a lot!

Viewing 9 reply threads
  • The topic ‘Customize vendor registration fields’ is closed to new replies.