order billing fields do not overwrite value, if provided
(overwriting introduced by 1fa36b5f15
)
This commit is contained in:
parent
2bb466d53f
commit
233ac4b313
|
@ -332,7 +332,9 @@ class WC_Meta_Box_Order_Data {
|
|||
|
||||
$field_name = 'billing_' . $key;
|
||||
|
||||
if ( is_callable( array( $order, 'get_' . $field_name ) ) ) {
|
||||
if ( isset( $field['value'] ) ) {
|
||||
$field_value = $field['value'];
|
||||
} elseif ( is_callable( array( $order, 'get_' . $field_name ) ) ) {
|
||||
$field_value = $order->{"get_$field_name"}( 'edit' );
|
||||
} else {
|
||||
$field_value = $order->get_meta( '_' . $field_name );
|
||||
|
@ -365,10 +367,12 @@ class WC_Meta_Box_Order_Data {
|
|||
|
||||
$field_name = 'billing_' . $key;
|
||||
|
||||
if ( is_callable( array( $order, 'get_' . $field_name ) ) ) {
|
||||
$field['value'] = $order->{"get_$field_name"}( 'edit' );
|
||||
} else {
|
||||
$field['value'] = $order->get_meta( '_' . $field_name );
|
||||
if ( ! isset( $field['value'] ) ) {
|
||||
if ( is_callable( array( $order, 'get_' . $field_name ) ) ) {
|
||||
$field['value'] = $order->{"get_$field_name"}( 'edit' );
|
||||
} else {
|
||||
$field['value'] = $order->get_meta( '_' . $field_name );
|
||||
}
|
||||
}
|
||||
|
||||
switch ( $field['type'] ) {
|
||||
|
|
Loading…
Reference in New Issue