From 7fb49c4b68b00b791eaa786443687307d22e145b Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 23 Sep 2013 16:22:25 +0100 Subject: [PATCH] Round price adjustments. Closes #3797. --- includes/admin/post-types/class-wc-admin-cpt-product.php | 2 ++ 1 file changed, 2 insertions(+) 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 9682a78f207..ce5697c7e34 100644 --- a/includes/admin/post-types/class-wc-admin-cpt-product.php +++ b/includes/admin/post-types/class-wc-admin-cpt-product.php @@ -812,6 +812,7 @@ class WC_Admin_CPT_Product extends WC_Admin_CPT { if ( isset( $new_price ) && $new_price != $old_regular_price ) { $price_changed = true; + $new_price = number_format( $new_price, absint( get_option( 'woocommerce_price_num_decimals' ) ), '.', '' ); update_post_meta( $post_id, '_regular_price', $new_price ); $product->regular_price = $new_price; } @@ -854,6 +855,7 @@ class WC_Admin_CPT_Product extends WC_Admin_CPT { if ( isset( $new_price ) && $new_price != $old_sale_price ) { $price_changed = true; + $new_price = number_format( $new_price, absint( get_option( 'woocommerce_price_num_decimals' ) ), '.', '' ); update_post_meta( $post_id, '_sale_price', $new_price ); $product->sale_price = $new_price; }