Preserve original meta value.
This commit is contained in:
parent
e557241a6b
commit
a0a231f804
|
@ -716,10 +716,8 @@ abstract class Abstract_WC_Order_Data_Store_CPT extends WC_Data_Store_WP impleme
|
|||
foreach ( $order->get_meta_data() as $meta_data ) {
|
||||
if ( isset( $existing_meta_data[ $meta_data->key ] ) ) {
|
||||
// We don't know if the meta is single or array, so we assume it to be array.
|
||||
if ( ! is_array( $meta_data->value ) ) {
|
||||
$meta_data->value = array( $meta_data->value );
|
||||
}
|
||||
if ( $existing_meta_data[ $meta_data->key ] === $meta_data->value ) {
|
||||
$meta_value = is_array( $meta_data->value ) ? $meta_data->value : array( $meta_data->value );
|
||||
if ( $existing_meta_data[ $meta_data->key ] === $meta_value ) {
|
||||
unset( $existing_meta_data[ $meta_data->key ] );
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue