From a85201ae2c19c6b46da865e77ab9b07407549918 Mon Sep 17 00:00:00 2001 From: Scott Basgaard Date: Fri, 25 Oct 2013 15:25:58 +0200 Subject: [PATCH] Don't forget to round with woocommerce_price_num_decimals option --- includes/admin/post-types/class-wc-admin-cpt-product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/post-types/class-wc-admin-cpt-product.php b/includes/admin/post-types/class-wc-admin-cpt-product.php index 5f470918042..f7daa28175d 100644 --- a/includes/admin/post-types/class-wc-admin-cpt-product.php +++ b/includes/admin/post-types/class-wc-admin-cpt-product.php @@ -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 + ( round( $old_regular_price * $percent ) ); + $new_price = $old_regular_price + ( round( $old_regular_price * $percent, absint( get_option( 'woocommerce_price_num_decimals' ) ) ) ); } 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 - ( round ( $old_regular_price * $percent ) ); + $new_price = $old_regular_price - ( round ( $old_regular_price * $percent, absint( get_option( 'woocommerce_price_num_decimals' ) ) )); } else { $new_price = $old_regular_price - $regular_price; }