diff --git a/assets/js/admin/meta-boxes-order.js b/assets/js/admin/meta-boxes-order.js index 18bfdce16c2..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; + window.location.reload(); } else { window.alert( response.data.error ); wc_meta_boxes_order_items.reload_items(); diff --git a/assets/js/admin/meta-boxes-product-variation.js b/assets/js/admin/meta-boxes-product-variation.js index 560a868ede4..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,7 +530,14 @@ jQuery( function( $ ) { * After saved, continue with form submission */ save_on_submit_done: function() { - $( 'form#post' ).submit(); + var postForm = $( 'form#post' ), + callerid = postForm.data( 'callerid' ); + + if ( 'publish' === callerid ) { + postForm.append('').submit(); + } else { + postForm.append('').submit(); + } }, /** 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 ) : ?> - + diff --git a/includes/admin/meta-boxes/views/html-variation-admin.php b/includes/admin/meta-boxes/views/html-variation-admin.php index 06e3823884f..5e1cef7b3ea 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 ) : ?> - + diff --git a/includes/class-wc-cart-totals.php b/includes/class-wc-cart-totals.php index 538977363f0..55bf6d5e072 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.5.4 + * @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. * diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index ff553d8ec82..ff71246af43 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -2908,14 +2908,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 .= ''; } } } @@ -3406,7 +3406,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'] ); } diff --git a/templates/order/form-tracking.php b/templates/order/form-tracking.php index 20d34e32512..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; ?> -