• Resolved prasadd1989

    (@prasadd1989)


    Hello,

    I want to add extra custom field on vendor registration form for Store Code, I have added it and it is saving in wp_usermeta as with meta_key “store-code”, I want to save this meta key as “store_code” instead of using dash between the key name, I want to use “_” underscore. How can I achieve this. Can I change this by adding some code snippet in functions.php. Please help me and suggest for the solution.
    Thanks in advance for the help.

    Thanks & regards
    Prasad D.

    • This topic was modified 4 years, 4 months ago by prasadd1989.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Please add this snippet to your functions.php –

    add_action( 'wcfm_membership_registration', function( $member_id, $wcfm_membership_registration_form_data ) {
      $wcfmvm_custom_infos = (array) $wcfm_membership_registration_form_data['wcfmvm_custom_infos'];
    	if( isset( $wcfmvm_custom_infos['store-code'] ) ) {
    		update_user_meta( $member_id, 'store_code', $wcfmvm_custom_infos['store-code'] );
    	}
    }, 50, 2 );

    Thank You

    Thread Starter prasadd1989

    (@prasadd1989)

    Thanks for the snippet, this is really helpful.

    one more thing, how do I achieve this without adding custom field on the vendor registration form, can I update store_code field while vendor registration automatically by assigning some unique code, How do I achieve this. do not want to add custom field on the vendor registration form.

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Extra custom field on Vendor Registration Form’ is closed to new replies.