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:
Claudio Sanches 2015-04-30 21:44:07 -03:00
commit 5662e3a1bd
1 changed files with 3 additions and 1 deletions

View File

@ -1241,11 +1241,13 @@ class WC_Admin_Post_Types {
break;
}
if ( isset( $new_price ) && $new_price != $old_sale_price ) {
if ( ! empty( $new_price ) && $new_price != $old_sale_price ) {
$price_changed = true;
$new_price = round( $new_price, wc_get_price_decimals() );
update_post_meta( $post_id, '_sale_price', $new_price );
$product->sale_price = $new_price;
} else {
update_post_meta( $post_id, '_sale_price', '' );
}
}