From 15230e295c9352248605fd5bb6feb66703acae39 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 22 Nov 2017 10:49:28 +0000 Subject: [PATCH] Add precision after multiplying quantity Closes #17860 Has no effect on core it seems because we only store prices to the DP setting. This would be to correct precision added by plugins. --- includes/class-wc-cart-totals.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-cart-totals.php b/includes/class-wc-cart-totals.php index 8a0c128701f..fadaa07ffee 100644 --- a/includes/class-wc-cart-totals.php +++ b/includes/class-wc-cart-totals.php @@ -227,7 +227,7 @@ final class WC_Cart_Totals { $item->taxable = 'taxable' === $cart_item['data']->get_tax_status(); $item->price_includes_tax = wc_prices_include_tax(); $item->quantity = $cart_item['quantity']; - $item->price = wc_add_number_precision_deep( $cart_item['data']->get_price() ) * $cart_item['quantity']; + $item->price = wc_add_number_precision_deep( $cart_item['data']->get_price() * $cart_item['quantity'] ); $item->product = $cart_item['data']; $item->tax_rates = $this->get_item_tax_rates( $item ); $this->items[ $cart_item_key ] = $item;