I’ve two customized fields included within the checkout web page and in addition within the edit tackle web page in myaccounts of woocommerce. The issue is the 2 customized fields ‘billing_door’ and ‘billing_flatname’ should not getting up to date if modified from edit tackle web page.
The code I am utilizing to show the fields is beneath. Now how do I replace these fields and retailer it within the database. Thanks prematurely
operate custom_address_to_edit( $tackle ) {
world $wp_query;
if ( isset( $wp_query->query_vars['edit-address'] ) && $wp_query->query_vars['edit-address'] != 'billing' ) {
return $tackle;
}
if ( ! isset( $tackle['billing_door'] ) ) {
$tackle['billing_door'] = array(
'label' => __('Door No / Flat No', 'woocommerce'),
'placeholder' => _x('Enter your door quantity', 'placeholder', 'woocommerce'),
'required' => true,
'class' => array('form-row-first','update_totals_on_change'),
'worth' => get_user_meta( get_current_user_id(), 'billing_door', true )
);
}
if ( ! isset( $tackle['billing_flatname'] ) ) {
$tackle['billing_flatname'] = array(
'label' => __('Constructing Identify', 'woocommerce'),
'placeholder' => _x('Enter your constructing title', 'placeholder', 'woocommerce'),
'required' => false,
'class' => array('form-row-last','update_totals_on_change'),
'worth' => get_user_meta( get_current_user_id(), 'billing_flatname', true )
);
}
return $tackle;}