yusuf
January 23, 2024, 2:11pm
1
I have created a registration form using bricks builder form and I want to save the telephone field along with the form, in the user meta data.
I use WooCommerce and I want to save this field in WooCommerce billing phone.
Could Some one please help me with this?
yusuf
January 24, 2024, 7:41am
2
I would be grateful if anyone could help me with any information about this issue.
yusuf
January 24, 2024, 12:43pm
4
@clickfusion63 Thank you so much for response. after a little change, the code worked perfectly.
here is the customized code for this specific need(thanks to @mudy ):
function my_form_custom_action($form) {
$fields = $form->get_fields();
$user_id = get_current_user_id();
if ($fields['form-field-3086d2'] != null) {
// Update WooCommerce billing phone
update_user_meta($user_id, 'billing_phone', $fields['form-field-3086d2']);
}
}
add_action('bricks/form/custom_action', 'my_form_custom_action', 10, 1);