Merge pull request #8089 from roykho/bulk-edit
[2.3] fixed issue with bulk edit sale price saving as 0 when not entering any value fixes #8076
This commit is contained in:
commit
5662e3a1bd
|
@ -1241,11 +1241,13 @@ class WC_Admin_Post_Types {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $new_price ) && $new_price != $old_sale_price ) {
|
if ( ! empty( $new_price ) && $new_price != $old_sale_price ) {
|
||||||
$price_changed = true;
|
$price_changed = true;
|
||||||
$new_price = round( $new_price, wc_get_price_decimals() );
|
$new_price = round( $new_price, wc_get_price_decimals() );
|
||||||
update_post_meta( $post_id, '_sale_price', $new_price );
|
update_post_meta( $post_id, '_sale_price', $new_price );
|
||||||
$product->sale_price = $new_price;
|
$product->sale_price = $new_price;
|
||||||
|
} else {
|
||||||
|
update_post_meta( $post_id, '_sale_price', '' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue