Round product % price inc/dec in bulk edit. Resolves #4001

This commit is contained in:
Scott Basgaard 2013-10-25 15:19:03 +02:00
parent dee6bba05c
commit a3a1753c00
1 changed files with 2 additions and 2 deletions

View File

@ -795,7 +795,7 @@ class WC_Admin_CPT_Product extends WC_Admin_CPT {
case 2 :
if ( strstr( $regular_price, '%' ) ) {
$percent = str_replace( '%', '', $regular_price ) / 100;
$new_price = $old_regular_price + ( $old_regular_price * $percent );
$new_price = $old_regular_price + ( round( $old_regular_price * $percent ) );
} else {
$new_price = $old_regular_price + $regular_price;
}
@ -803,7 +803,7 @@ class WC_Admin_CPT_Product extends WC_Admin_CPT {
case 3 :
if ( strstr( $regular_price, '%' ) ) {
$percent = str_replace( '%', '', $regular_price ) / 100;
$new_price = $old_regular_price - ( $old_regular_price * $percent );
$new_price = $old_regular_price - ( round ( $old_regular_price * $percent ) );
} else {
$new_price = $old_regular_price - $regular_price;
}