currently I am developing a site using the Dokan multivendor plugin. I added a custom field in the registration form and
The below code is being used to add the custom field in the registration form
<p class="form-row form-group form-row-wide">
<label for="tskypeid"><?php _e( 'Skype ID', 'dokan-lite' ); ?> <span class="required">*</span></label>
<input type="text" class="input-text form-control" name="tskypeid" id="tskype-id" value="<?php if ( ! empty( $postdata['tskypeid'] ) ) echo esc_attr($postdata['tskypeid']); ?>" required="required" />
</p>
This is code that is being used to save the field data:
// save skype id after registration
function ms_dokan_on_create_seller( $user_id, $data ) {
if ( $data['role'] != 'seller' ) {
return;
}
$dokan_settings = array(
'tskypeid' => $_POST['tskypeid'],
);
update_user_meta( $user_id, 'dokan_profile_settings', $dokan_settings );
update_user_meta( $user_id, 'dokan_store_name', $dokan_settings['store_name'] );
do_action( 'dokan_new_seller_created', $user_id, $dokan_settings );
}
add_action( 'woocommerce_created_customer', 'ms_dokan_on_create_seller', 10, 2);
tried to access the value using the below code:
function wc_vendors_name_loop( $store_id ) {
$user_id = get_current_user_id();
$dokan_profile_settings = get_user_meta( $user_id )
['dokan_profile_settings'];
echo "<pre>";
var_dump( $dokan_profile_settings );
echo "</pre>";
}
add_action( 'wp_footer', 'wc_vendors_name_loop' );
This code outputs the below result:
array(1) {
[0]=>
string(1183)
"a:17:{
s:8:"tskypeid";
s:7:"asdfasd";
s:10:"store_name";
s:17:"asdfas dfasdfasdf";
s:9:"store_ppp";
i:0;s:7:"address";
a:6:{
s:8:"street_1";
s:19:"fasdf asdf asdf sad";
s:8:"street_2";
s:15:"sadf asdf asd f";
s:4:"city";
s:10:"asdf asd f";
s:3:"zip";
s:8:"sad fsad";
s:7:"country";
s:2:"AZ";
s:5:"state";
s:9:"asdfasdf ";
}
s:8:
"location";
s:0:"";
s:12:"find_address";
s:27:"dsfas sadf sadfsadfsadf asf";
s:6:"banner";
i:0;s:5:"phone";
s:9:"345346456";
s:10:"show_email";
s:3:"yes";
s:14:"show_more_ptab";
s:3:"yes";
s:8:"gravatar";
i:0;s:10:"enable_tnc";
s:2:"on";
s:9:"store_tnc";
s:27:"asdf asdf asdfa sdf sadfsdf";
s:18:"profile_completion";
a:6:{
s:5:"phone";
i:10;s:10:"store_name";
i:10;s:7:"address";
i:10;s:9:"next_todo";
s:31:"Add Banner to gain 15% progress";
s:8:"progress";
i:30;s:13:"progress_vals";
a:8:{
s:10:"banner_val";
i:15;s:19:"profile_picture_val";
i:15;s:14:"store_name_val";
i:10;s:10:"social_val";
a:5:{
s:2:"fb";
i:2;s:5:"gplus";
i:2;s:7:"twitter";
i:2;s:7:"youtube";
i:2;s:8:"linkedin";
i:2;
}
s:18:"payment_method_val";
i:15;s:9:"phone_val";
i:10;s:11:"address_val";
i:10;s:7:"map_val";
i:15;
}
}
s:23:"show_min_order_discount";
s:2:"no";
s:28:"setting_minimum_order_amount";
s:0:"";
s:24:"setting_order_percentage";
s:0:"";
}"
}
Here I want to access the value of "tskypeid" in line 5 and the value is "asdfasd" in line 6
Please tell me how can I access that value.
Any help will be greatly appreciated.
Thank you in advance.