From cb693a5ccdfcc97a24062660ad5adfe0f2a5b656 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 29 Jun 2018 13:58:47 +0100 Subject: [PATCH 01/19] Make form aware publish was pressed --- assets/js/admin/meta-boxes-product-variation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/admin/meta-boxes-product-variation.js b/assets/js/admin/meta-boxes-product-variation.js index 560a868ede4..e1e7fcf8e12 100644 --- a/assets/js/admin/meta-boxes-product-variation.js +++ b/assets/js/admin/meta-boxes-product-variation.js @@ -524,7 +524,7 @@ jQuery( function( $ ) { * After saved, continue with form submission */ save_on_submit_done: function() { - $( 'form#post' ).submit(); + $( 'form#post' ).append('').submit(); }, /** From 111c2fded03c763c4b31de5f9813631a7aea7d62 Mon Sep 17 00:00:00 2001 From: James Kemp Date: Wed, 22 Aug 2018 11:37:47 +0100 Subject: [PATCH 02/19] Add more parameters to `woocommerce_variation_option_name` Add term, taxonomy, and product object to the `woocommerce_variation_option_name` filter. --- includes/wc-template-functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index ba3f3105a9f..648dd7ec0b4 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -2808,14 +2808,14 @@ if ( ! function_exists( 'wc_dropdown_variation_attribute_options' ) ) { foreach ( $terms as $term ) { if ( in_array( $term->slug, $options, true ) ) { - $html .= ''; + $html .= ''; } } } else { foreach ( $options as $option ) { // This handles < 2.4.0 bw compatibility where text attributes were not sanitized. $selected = sanitize_title( $args['selected'] ) === $args['selected'] ? selected( $args['selected'], sanitize_title( $option ), false ) : selected( $args['selected'], $option, false ); - $html .= ''; + $html .= ''; } } } @@ -3278,7 +3278,7 @@ function wc_get_formatted_cart_item_data( $cart_item, $flat = false ) { $label = wc_attribute_label( $taxonomy ); } else { // If this is a custom option slug, get the options name. - $value = apply_filters( 'woocommerce_variation_option_name', $value ); + $value = apply_filters( 'woocommerce_variation_option_name', $value, null, $taxonomy, $cart_item['data'] ); $label = wc_attribute_label( str_replace( 'attribute_', '', $name ), $cart_item['data'] ); } From 9fe201dd86076a33fa633192645160780a0c224e Mon Sep 17 00:00:00 2001 From: James Kemp Date: Wed, 22 Aug 2018 11:44:40 +0100 Subject: [PATCH 03/19] Add parameters to `woocommerce_variation_option_name` in admin view --- includes/admin/meta-boxes/views/html-variation-admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/meta-boxes/views/html-variation-admin.php b/includes/admin/meta-boxes/views/html-variation-admin.php index 96e20d2ea1c..df70677cf67 100644 --- a/includes/admin/meta-boxes/views/html-variation-admin.php +++ b/includes/admin/meta-boxes/views/html-variation-admin.php @@ -35,11 +35,11 @@ if ( ! defined( 'ABSPATH' ) ) { is_taxonomy() ) : ?> get_terms() as $option ) : ?> - + get_options() as $option ) : ?> - + From 1ca1189f79cb337b40607a2a210b035a7f291aaa Mon Sep 17 00:00:00 2001 From: James Kemp Date: Wed, 22 Aug 2018 11:49:17 +0100 Subject: [PATCH 04/19] Add params to `woocommerce_variation_option_name` for admin variations --- .../admin/meta-boxes/views/html-product-data-variations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/meta-boxes/views/html-product-data-variations.php b/includes/admin/meta-boxes/views/html-product-data-variations.php index 36c6a32d8b6..c6ebfac5006 100644 --- a/includes/admin/meta-boxes/views/html-product-data-variations.php +++ b/includes/admin/meta-boxes/views/html-product-data-variations.php @@ -33,11 +33,11 @@ if ( ! defined( 'ABSPATH' ) ) { is_taxonomy() ) : ?> get_terms() as $option ) : ?> - + get_options() as $option ) : ?> - + From dafcbc56b096065e0687bedd05e22cf67307d686 Mon Sep 17 00:00:00 2001 From: Grzegorz Rola Date: Wed, 29 Aug 2018 13:22:51 +0200 Subject: [PATCH 05/19] Taxes should be rounded on subtotals in cart when option woocommerce_tax_round_at_subtotal is checked. --- includes/class-wc-cart-totals.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/includes/class-wc-cart-totals.php b/includes/class-wc-cart-totals.php index 538977363f0..b7ce7cf3686 100644 --- a/includes/class-wc-cart-totals.php +++ b/includes/class-wc-cart-totals.php @@ -580,9 +580,28 @@ final class WC_Cart_Totals { } } + $taxes = $this->round_merged_taxes( $taxes ); + return $in_cents ? $taxes : wc_remove_number_precision_deep( $taxes ); } + /** + * Round merged taxes. + * + * @since 3.4.5 + * @param array $taxes Taxes to round. + * @return array + */ + protected function round_merged_taxes( $taxes ) { + if ( $this->round_at_subtotal() ) { + foreach ( $taxes as $rate_id => $tax ) { + $taxes[ $rate_id ] = wc_round_tax_total( $tax, 0 ); + } + } + + return $taxes; + } + /** * Combine item taxes into a single array, preserving keys. * From 5c3f4c9c10226e2a3cf888109339e9dfb79d7c7a Mon Sep 17 00:00:00 2001 From: Grzegorz Rola Date: Wed, 29 Aug 2018 13:25:22 +0200 Subject: [PATCH 06/19] Revert "Taxes should be rounded on subtotals in cart when option woocommerce_tax_round_at_subtotal is checked." This reverts commit dafcbc5 --- includes/class-wc-cart-totals.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/includes/class-wc-cart-totals.php b/includes/class-wc-cart-totals.php index b7ce7cf3686..538977363f0 100644 --- a/includes/class-wc-cart-totals.php +++ b/includes/class-wc-cart-totals.php @@ -580,28 +580,9 @@ final class WC_Cart_Totals { } } - $taxes = $this->round_merged_taxes( $taxes ); - return $in_cents ? $taxes : wc_remove_number_precision_deep( $taxes ); } - /** - * Round merged taxes. - * - * @since 3.4.5 - * @param array $taxes Taxes to round. - * @return array - */ - protected function round_merged_taxes( $taxes ) { - if ( $this->round_at_subtotal() ) { - foreach ( $taxes as $rate_id => $tax ) { - $taxes[ $rate_id ] = wc_round_tax_total( $tax, 0 ); - } - } - - return $taxes; - } - /** * Combine item taxes into a single array, preserving keys. * From 20ac4a8b69d5acd9af81b35982b52878fd738cd0 Mon Sep 17 00:00:00 2001 From: Grzegorz Rola Date: Wed, 29 Aug 2018 13:34:22 +0200 Subject: [PATCH 07/19] Taxes should be rounded on subtotals in cart when option woocommerce_tax_round_at_subtotal is checked. --- includes/class-wc-cart-totals.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/includes/class-wc-cart-totals.php b/includes/class-wc-cart-totals.php index 538977363f0..34f64c1f396 100644 --- a/includes/class-wc-cart-totals.php +++ b/includes/class-wc-cart-totals.php @@ -579,10 +579,28 @@ final class WC_Cart_Totals { $taxes[ $rate_id ] += $this->round_line_tax( $rate ); } } + $taxes = $this->round_merged_taxes( $taxes ); return $in_cents ? $taxes : wc_remove_number_precision_deep( $taxes ); } + /** + * Round merged taxes. + * + * @since 3.4.5 + * @param array $taxes Taxes to round. + * @return array + */ + protected function round_merged_taxes( $taxes ) { + if ( $this->round_at_subtotal() ) { + foreach ( $taxes as $rate_id => $tax ) { + $taxes[ $rate_id ] = wc_round_tax_total( $tax, 0 ); + } + } + + return $taxes; + } + /** * Combine item taxes into a single array, preserving keys. * From 9df10fac5ae358f27771851e5fdea991def7ce6d Mon Sep 17 00:00:00 2001 From: Grzegorz Rola Date: Wed, 29 Aug 2018 13:43:13 +0200 Subject: [PATCH 08/19] Taxes should be rounded on subtotals in cart when option woocommerce_tax_round_at_subtotal is checked. --- 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 34f64c1f396..35ae4b1552c 100644 --- a/includes/class-wc-cart-totals.php +++ b/includes/class-wc-cart-totals.php @@ -591,7 +591,7 @@ final class WC_Cart_Totals { * @param array $taxes Taxes to round. * @return array */ - protected function round_merged_taxes( $taxes ) { + protected function round_merged_taxes( array $taxes ) { if ( $this->round_at_subtotal() ) { foreach ( $taxes as $rate_id => $tax ) { $taxes[ $rate_id ] = wc_round_tax_total( $tax, 0 ); From 9e32117d732f755c394ca49c549152a3181c9e9b Mon Sep 17 00:00:00 2001 From: Grzegorz Rola Date: Wed, 29 Aug 2018 18:18:57 +0200 Subject: [PATCH 09/19] Tests. --- tests/unit-tests/cart/cart.php | 84 ++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/tests/unit-tests/cart/cart.php b/tests/unit-tests/cart/cart.php index f5b6e9db918..caae1738898 100644 --- a/tests/unit-tests/cart/cart.php +++ b/tests/unit-tests/cart/cart.php @@ -11,6 +11,90 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { WC()->cart->empty_cart(); } + /** + * Test tax rounding. + * Ticket: + * https://github.com/woocommerce/woocommerce/issues/21021 + */ + public function test_cart_get_total_issue_21021() { + update_option( 'woocommerce_prices_include_tax', 'yes' ); + update_option( 'woocommerce_calc_taxes', 'yes' ); + update_option( 'woocommerce_tax_round_at_subtotal', 'yes' ); + + $tax_rate = array( + 'tax_rate_country' => '', + 'tax_rate_state' => '', + 'tax_rate' => '23.0000', + 'tax_rate_name' => 'TAX23', + 'tax_rate_priority' => '1', + 'tax_rate_compound' => '0', + 'tax_rate_shipping' => '1', + 'tax_rate_order' => '1', + 'tax_rate_class' => '23percent', + ); + WC_Tax::_insert_tax_rate( $tax_rate ); + + $tax_rate = array( + 'tax_rate_country' => '', + 'tax_rate_state' => '', + 'tax_rate' => '5.0000', + 'tax_rate_name' => 'TAX5', + 'tax_rate_priority' => '2', + 'tax_rate_compound' => '0', + 'tax_rate_shipping' => '0', + 'tax_rate_order' => '1', + 'tax_rate_class' => '5percent', + ); + WC_Tax::_insert_tax_rate( $tax_rate ); + + // Create product with price 19 + $product = WC_Helper_Product::create_simple_product(); + $product->set_price( 19 ); + $product->set_regular_price(19 ); + $product->set_tax_class('5percent'); + $product->save(); + + // Create product with price 59 + $product2 = WC_Helper_Product::create_simple_product(); + $product2->set_price( 59 ); + $product2->set_regular_price(59 ); + $product->set_tax_class('5percent'); + $product2->save(); + + + // Create a flat rate method. + $flat_rate_settings = array( + 'enabled' => 'yes', + 'title' => 'Flat rate', + 'availability' => 'all', + 'countries' => '', + 'tax_status' => 'taxable', + 'cost' => '8.05', + ); + update_option( 'woocommerce_flat_rate_settings', $flat_rate_settings ); + update_option( 'woocommerce_flat_rate', array() ); + WC_Cache_Helper::get_transient_version( 'shipping', true ); + WC()->shipping->load_shipping_methods(); + + WC()->cart->empty_cart(); + + // Set the flat_rate shipping method + WC()->session->set( 'chosen_shipping_methods', array( 'flat_rate' ) ); + + // Add product to cart x1, calc and test + WC()->cart->add_to_cart( $product->get_id(), 1 ); + WC()->session->set( 'chosen_shipping_methods', array( 'flat_rate' ) ); + WC()->cart->calculate_totals(); + $this->assertEquals( 28.9, WC()->cart->total ); + + // Add product2 to cart + WC()->cart->add_to_cart( $product2->get_id(), 1 ); + WC()->session->set( 'chosen_shipping_methods', array( 'flat_rate' ) ); + WC()->cart->calculate_totals(); + $this->assertEquals( 87.9, WC()->cart->total ); + + } + /** * Test some discount logic which has caused issues in the past. * Ticket: From 2a7d84c208c1ae154df92c890941189bd0742866 Mon Sep 17 00:00:00 2001 From: Grzegorz Rola Date: Wed, 29 Aug 2018 19:24:29 +0200 Subject: [PATCH 10/19] Clean data after test. --- tests/unit-tests/cart/cart.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/unit-tests/cart/cart.php b/tests/unit-tests/cart/cart.php index caae1738898..0822fe5f36c 100644 --- a/tests/unit-tests/cart/cart.php +++ b/tests/unit-tests/cart/cart.php @@ -32,7 +32,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '23percent', ); - WC_Tax::_insert_tax_rate( $tax_rate ); + $tax_rate_23 = WC_Tax::_insert_tax_rate( $tax_rate ); $tax_rate = array( 'tax_rate_country' => '', @@ -45,7 +45,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { 'tax_rate_order' => '1', 'tax_rate_class' => '5percent', ); - WC_Tax::_insert_tax_rate( $tax_rate ); + $tax_rate_5 = WC_Tax::_insert_tax_rate( $tax_rate ); // Create product with price 19 $product = WC_Helper_Product::create_simple_product(); @@ -61,7 +61,6 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { $product->set_tax_class('5percent'); $product2->save(); - // Create a flat rate method. $flat_rate_settings = array( 'enabled' => 'yes', @@ -93,6 +92,12 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { WC()->cart->calculate_totals(); $this->assertEquals( 87.9, WC()->cart->total ); + WC_Helper_Product::delete_product( $product->get_id() ); + WC_Helper_Product::delete_product( $product2->get_id() ); + + WC_Tax::_delete_tax_rate( $tax_rate_23 ); + WC_Tax::_delete_tax_rate( $tax_rate_5 ); + } /** From a1cc4395695a4ca45f647444c5cc3f6e5f6ef07a Mon Sep 17 00:00:00 2001 From: Grzegorz Rola Date: Wed, 29 Aug 2018 19:43:57 +0200 Subject: [PATCH 11/19] Code style changes. --- tests/unit-tests/cart/cart.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit-tests/cart/cart.php b/tests/unit-tests/cart/cart.php index 0822fe5f36c..3555906dc30 100644 --- a/tests/unit-tests/cart/cart.php +++ b/tests/unit-tests/cart/cart.php @@ -50,15 +50,15 @@ class WC_Tests_Cart extends WC_Unit_Test_Case { // Create product with price 19 $product = WC_Helper_Product::create_simple_product(); $product->set_price( 19 ); - $product->set_regular_price(19 ); - $product->set_tax_class('5percent'); + $product->set_regular_price( 19 ); + $product->set_tax_class( '5percent' ); $product->save(); // Create product with price 59 $product2 = WC_Helper_Product::create_simple_product(); $product2->set_price( 59 ); - $product2->set_regular_price(59 ); - $product->set_tax_class('5percent'); + $product2->set_regular_price( 59 ); + $product->set_tax_class( '5percent' ); $product2->save(); // Create a flat rate method. From 5ee8a794f0648105dd1893959a966c1fb54f6f90 Mon Sep 17 00:00:00 2001 From: Raymond Johnson Date: Thu, 30 Aug 2018 17:53:32 -0500 Subject: [PATCH 12/19] Add consistent classes to order tracking form. --- templates/order/form-tracking.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/order/form-tracking.php b/templates/order/form-tracking.php index 20d34e32512..631f2cd776f 100644 --- a/templates/order/form-tracking.php +++ b/templates/order/form-tracking.php @@ -20,7 +20,7 @@ defined( 'ABSPATH' ) || exit; global $post; ?> -
+

From 36cf6d64b8784af7952e810b76efc18f22334d2a Mon Sep 17 00:00:00 2001 From: Gerhard Potgieter Date: Mon, 10 Sep 2018 11:23:12 +0200 Subject: [PATCH 13/19] Check the post status and set the hidden field based on that before submitting. --- assets/js/admin/meta-boxes-product-variation.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/js/admin/meta-boxes-product-variation.js b/assets/js/admin/meta-boxes-product-variation.js index e1e7fcf8e12..44f9d486292 100644 --- a/assets/js/admin/meta-boxes-product-variation.js +++ b/assets/js/admin/meta-boxes-product-variation.js @@ -524,7 +524,11 @@ jQuery( function( $ ) { * After saved, continue with form submission */ save_on_submit_done: function() { - $( 'form#post' ).append('').submit(); + if ( $( '#hidden_post_status' ).val() !== 'publish' ) { + $( 'form#post' ).append('').submit(); + } else { + $( 'form#post' ).append('').submit(); + } }, /** From a16eba85436fa96572ac227c3443e0a5a5152e72 Mon Sep 17 00:00:00 2001 From: Joshua Flowers Date: Tue, 4 Dec 2018 10:11:40 +0800 Subject: [PATCH 14/19] Strip hash from URL that prevents reload on refunds --- assets/js/admin/meta-boxes-order.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/admin/meta-boxes-order.js b/assets/js/admin/meta-boxes-order.js index 18bfdce16c2..f3ee4b311e6 100644 --- a/assets/js/admin/meta-boxes-order.js +++ b/assets/js/admin/meta-boxes-order.js @@ -750,7 +750,7 @@ jQuery( function ( $ ) { $.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) { if ( true === response.success ) { // Redirect to same page for show the refunded status - window.location.href = window.location.href; + window.location.href = window.location.href.split('#')[0]; } else { window.alert( response.data.error ); wc_meta_boxes_order_items.reload_items(); From dc12b7d2d6bcee77de6c6772bd5d21229683fa27 Mon Sep 17 00:00:00 2001 From: Joshua Flowers Date: Thu, 13 Dec 2018 11:10:23 +0800 Subject: [PATCH 15/19] Use reload instead of assigning href to window.location --- assets/js/admin/meta-boxes-order.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/admin/meta-boxes-order.js b/assets/js/admin/meta-boxes-order.js index f3ee4b311e6..ce9c9c9f704 100644 --- a/assets/js/admin/meta-boxes-order.js +++ b/assets/js/admin/meta-boxes-order.js @@ -750,7 +750,7 @@ jQuery( function ( $ ) { $.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) { if ( true === response.success ) { // Redirect to same page for show the refunded status - window.location.href = window.location.href.split('#')[0]; + window.location.reload(); } else { window.alert( response.data.error ); wc_meta_boxes_order_items.reload_items(); From 83543a9232e3071453d3a9ed32ff6fbacad6dfd1 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 9 Jan 2019 16:31:53 +0000 Subject: [PATCH 16/19] Handle publish and save post buttons by storing ID of button pressed --- assets/js/admin/meta-boxes-product-variation.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/assets/js/admin/meta-boxes-product-variation.js b/assets/js/admin/meta-boxes-product-variation.js index 44f9d486292..fdec680dd5b 100644 --- a/assets/js/admin/meta-boxes-product-variation.js +++ b/assets/js/admin/meta-boxes-product-variation.js @@ -329,7 +329,13 @@ jQuery( function( $ ) { .on( 'change', '#variable_product_options .woocommerce_variations :input', this.input_changed ) .on( 'change', '.variations-defaults select', this.defaults_changed ); - $( 'form#post' ).on( 'submit', this.save_on_submit ); + var postForm = $( 'form#post' ); + + postForm.on( 'submit', this.save_on_submit ); + + $( 'input:submit', postForm ).bind( 'click keypress', function() { + postForm.data( 'callerid', this.id ); + }); $( '.wc-metaboxes-wrapper' ).on( 'click', 'a.do_variation_action', this.do_variation_action ); }, @@ -524,10 +530,13 @@ jQuery( function( $ ) { * After saved, continue with form submission */ save_on_submit_done: function() { - if ( $( '#hidden_post_status' ).val() !== 'publish' ) { - $( 'form#post' ).append('').submit(); + var postForm = $( 'form#post' ), + callerid = postForm.data( 'callerid' ); + + if ( 'publish' === callerid ) { + postForm.append('').submit(); } else { - $( 'form#post' ).append('').submit(); + postForm.append('').submit(); } }, From 8c0e0b62cdf8e203ec82918ab1d05cd897d37a99 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 10 Jan 2019 12:24:48 +0000 Subject: [PATCH 17/19] Add legacy class and version bump --- templates/order/form-tracking.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/order/form-tracking.php b/templates/order/form-tracking.php index 631f2cd776f..be4eb2d9cc2 100644 --- a/templates/order/form-tracking.php +++ b/templates/order/form-tracking.php @@ -12,7 +12,7 @@ * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce/Templates - * @version 3.4.0 + * @version 3.6.0 */ defined( 'ABSPATH' ) || exit; @@ -20,7 +20,7 @@ defined( 'ABSPATH' ) || exit; global $post; ?> - +

From f67ab4e447efdaaceea5920f4a3cc6a286afa6d7 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 10 Jan 2019 13:20:02 +0000 Subject: [PATCH 18/19] correct version --- 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 35ae4b1552c..608dccda721 100644 --- a/includes/class-wc-cart-totals.php +++ b/includes/class-wc-cart-totals.php @@ -587,7 +587,7 @@ final class WC_Cart_Totals { /** * Round merged taxes. * - * @since 3.4.5 + * @since 3.5.4 * @param array $taxes Taxes to round. * @return array */ From 96ba549b2b670e57b053d26476ac76071561be8a Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 10 Jan 2019 13:23:49 +0000 Subject: [PATCH 19/19] Remove type hint --- 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 608dccda721..55bf6d5e072 100644 --- a/includes/class-wc-cart-totals.php +++ b/includes/class-wc-cart-totals.php @@ -591,7 +591,7 @@ final class WC_Cart_Totals { * @param array $taxes Taxes to round. * @return array */ - protected function round_merged_taxes( array $taxes ) { + protected function round_merged_taxes( $taxes ) { if ( $this->round_at_subtotal() ) { foreach ( $taxes as $rate_id => $tax ) { $taxes[ $rate_id ] = wc_round_tax_total( $tax, 0 );