From 954dd9d3bc27216bfb8a736bf204feca8edb1a30 Mon Sep 17 00:00:00 2001 From: Noel Springer Date: Fri, 13 Dec 2019 23:03:01 +1000 Subject: [PATCH] Update Woocommerce templates for 3.7.0 * Update woocommerce mini-cart template (3.6.1 => 3.7.0) * Update woocommerce myaccount/orders template (3.6.1 => 3.7.0) --- woocommerce/cart/mini-cart.php | 58 +++++++++++++++++++------------- woocommerce/myaccount/orders.php | 38 ++++++++++----------- 2 files changed, 53 insertions(+), 43 deletions(-) diff --git a/woocommerce/cart/mini-cart.php b/woocommerce/cart/mini-cart.php index 3b58593..aff9fa2 100644 --- a/woocommerce/cart/mini-cart.php +++ b/woocommerce/cart/mini-cart.php @@ -13,14 +13,11 @@ * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ - * @author WooThemes * @package WooCommerce/Templates - * @version 3.6.1 + * @version 3.7.0 */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; do_action( 'woocommerce_before_mini_cart' ); ?> @@ -28,7 +25,7 @@ do_action( 'woocommerce_before_mini_cart' ); ?> -

: cart->get_cart_subtotal(); ?>

+

+ +

+ + -

+

- diff --git a/woocommerce/myaccount/orders.php b/woocommerce/myaccount/orders.php index c3840f2..9190d86 100644 --- a/woocommerce/myaccount/orders.php +++ b/woocommerce/myaccount/orders.php @@ -12,15 +12,12 @@ * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * - * @see https://docs.woocommerce.com/document/template-structure/ - * @author WooThemes + * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce/Templates - * @version 3.6.1 + * @version 3.7.0 */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; do_action( 'woocommerce_before_account_orders', $has_orders ); ?> @@ -36,9 +33,10 @@ do_action( 'woocommerce_before_account_orders', $has_orders ); ?> - orders as $customer_order ) : - $order = wc_get_order( $customer_order ); - $item_count = $order->get_item_count(); + orders as $customer_order ) { + $order = wc_get_order( $customer_order ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited + $item_count = $order->get_item_count() - $order->get_item_count_refunded(); ?> $column_name ) : ?> @@ -48,7 +46,7 @@ do_action( 'woocommerce_before_account_orders', $has_orders ); ?> - get_order_number(); ?> + get_order_number() ); ?> @@ -60,7 +58,7 @@ do_action( 'woocommerce_before_account_orders', $has_orders ); ?> get_formatted_order_total(), $item_count ); + echo wp_kses_post( sprintf( _n( '%1$s for %2$s item', '%1$s for %2$s items', $item_count, 'understrap' ), $order->get_formatted_order_total(), $item_count ) ); ?> @@ -68,8 +66,8 @@ do_action( 'woocommerce_before_account_orders', $has_orders ); ?> $actions = wc_get_account_orders_actions( $order ); if ( ! empty( $actions ) ) { - foreach ( $actions as $key => $action ) { - echo '' . esc_html( $action['name'] ) . ''; + foreach ( $actions as $key => $action ) { // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited + echo '' . esc_html( $action['name'] ) . ''; } } ?> @@ -77,7 +75,9 @@ do_action( 'woocommerce_before_account_orders', $has_orders ); ?> - + @@ -86,11 +86,11 @@ do_action( 'woocommerce_before_account_orders', $has_orders ); ?> max_num_pages ) : ?>
- + max_num_pages ) !== $current_page ) : ?> - +
@@ -98,10 +98,10 @@ do_action( 'woocommerce_before_account_orders', $has_orders ); ?>
- + - +
-