From a43eabee369ca8f051a620cc3d015d71b192f821 Mon Sep 17 00:00:00 2001 From: Jason King Date: Thu, 29 Jun 2017 22:03:05 +0930 Subject: [PATCH 1/7] Woocommerce 3.1.0 Compatability --- woocommerce/cart/cart-empty.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/woocommerce/cart/cart-empty.php b/woocommerce/cart/cart-empty.php index 1f495be..07a5fd1 100644 --- a/woocommerce/cart/cart-empty.php +++ b/woocommerce/cart/cart-empty.php @@ -13,24 +13,21 @@ * @see https://docs.woocommerce.com/document/template-structure/ * @author WooThemes * @package WooCommerce/Templates - * @version 2.0.0 + * @version 3.1.0 */ if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. + exit; // Exit if accessed directly } wc_print_notices(); -?> +/** + * @hooked wc_empty_cart_message - 10 + */ +do_action( 'woocommerce_cart_is_empty' ); -

- -

- - - - 0 ) : ?> +if ( wc_get_page_id( 'shop' ) > 0 ) : ?>

From 870e184c7bf7f6188d4132ecd9b0ac817f2e088a Mon Sep 17 00:00:00 2001 From: Jason King Date: Thu, 29 Jun 2017 22:09:46 +0930 Subject: [PATCH 2/7] Woocommerce 3.1.0 Compatability --- woocommerce/cart/cart.php | 136 ++++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 66 deletions(-) diff --git a/woocommerce/cart/cart.php b/woocommerce/cart/cart.php index aa5ccc4..0b9a981 100644 --- a/woocommerce/cart/cart.php +++ b/woocommerce/cart/cart.php @@ -1,7 +1,7 @@ - + ?> - - get_image(), $cart_item, $cart_item_key ); + + get_image(), $cart_item, $cart_item_key ); - if ( ! $product_permalink ) { - echo $thumbnail; - } else { - printf( '%s', esc_url( $product_permalink ), $thumbnail ); - } - ?> - + if ( ! $product_permalink ) { + echo $thumbnail; + } else { + printf( '%s', esc_url( $product_permalink ), $thumbnail ); + } + ?> + - - get_title(), $cart_item, $cart_item_key ) . ' '; - } else { - echo apply_filters( 'woocommerce_cart_item_name', sprintf( '%s', esc_url( $product_permalink ), $_product->get_title() ), $cart_item, $cart_item_key ); - } + + get_name(), $cart_item, $cart_item_key ) . ' '; + } else { + echo apply_filters( 'woocommerce_cart_item_name', sprintf( '%s', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key ); + } - // Meta data - echo WC()->cart->get_item_data( $cart_item ); + // Meta data + echo WC()->cart->get_item_data( $cart_item ); - // Backorder notification - if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) { - echo '

' . esc_html__( 'Available on backorder', 'understrap' ) . '

'; - } - ?> - + // Backorder notification + if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) { + echo '

' . esc_html__( 'Available on backorder', 'woocommerce' ) . '

'; + } + ?> + - - cart->get_product_price( $_product ), $cart_item, $cart_item_key ); - ?> - + + cart->get_product_price( $_product ), $cart_item, $cart_item_key ); + ?> + - - is_sold_individually() ) { - $product_quantity = sprintf( '1 ', $cart_item_key ); - } else { - $product_quantity = woocommerce_quantity_input( array( - 'input_name' => "cart[{$cart_item_key}][qty]", - 'input_value' => $cart_item['quantity'], - 'max_value' => $_product->backorders_allowed() ? '' : $_product->get_stock_quantity(), - 'min_value' => '0' - ), $_product, false ); - } + + is_sold_individually() ) { + $product_quantity = sprintf( '1 ', $cart_item_key ); + } else { + $product_quantity = woocommerce_quantity_input( array( + 'input_name' => "cart[{$cart_item_key}][qty]", + 'input_value' => $cart_item['quantity'], + 'max_value' => $_product->get_max_purchase_quantity(), + 'min_value' => '0', + ), $_product, false ); + } - echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item ); - ?> - + echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item ); + ?> + - + cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); ?> @@ -128,9 +128,9 @@ do_action( 'woocommerce_before_cart' ); ?> ?> - - - + + +
@@ -141,24 +141,28 @@ do_action( 'woocommerce_before_cart' ); ?> - + - - - - - - - - - + + + + + + +
- - - +
From ce97bab35a5f6dc09372cd3a921f8ebd900c2c12 Mon Sep 17 00:00:00 2001 From: Jason King Date: Thu, 29 Jun 2017 22:13:34 +0930 Subject: [PATCH 3/7] Woocommerce 3.1.0 Compatability --- woocommerce/cart/mini-cart.php | 46 ++++++++++++++-------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/woocommerce/cart/mini-cart.php b/woocommerce/cart/mini-cart.php index c669be8..b16f34e 100644 --- a/woocommerce/cart/mini-cart.php +++ b/woocommerce/cart/mini-cart.php @@ -15,36 +15,34 @@ * @see https://docs.woocommerce.com/document/template-structure/ * @author WooThemes * @package WooCommerce/Templates - * @version 2.5.0 + * @version 3.1.0 */ - if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly + exit; } -?> +do_action( 'woocommerce_before_mini_cart' ); ?> - - -
    - - cart->is_empty() ) : ?> +cart->is_empty() ) : ?> +
      cart->get_cart() as $cart_item_key => $cart_item ) { $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key ); if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key ) ) { - $product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_title(), $cart_item, $cart_item_key ); + $product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ); $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key ); $product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key ); ?> -
    • +
    • ×', + '×', esc_url( WC()->cart->get_remove_url( $cart_item_key ) ), esc_attr__( 'Remove this item', 'understrap' ), esc_attr( $product_id ), @@ -65,26 +63,20 @@ if ( ! defined( 'ABSPATH' ) ) { +
    - - -
  • - - - -
- -cart->is_empty() ) : ?> - -

: cart->get_cart_subtotal(); ?>

+

: cart->get_cart_subtotal(); ?>

-

- - -

+

+ + + +

From fef3d207712aded0b046b9d08115362bb52a46ce Mon Sep 17 00:00:00 2001 From: Jason King Date: Thu, 29 Jun 2017 22:16:27 +0930 Subject: [PATCH 4/7] Woocommerce 3.1.0 Compatability --- woocommerce/single-product/product-thumbnails.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/woocommerce/single-product/product-thumbnails.php b/woocommerce/single-product/product-thumbnails.php index ace91d0..ad0bce8 100644 --- a/woocommerce/single-product/product-thumbnails.php +++ b/woocommerce/single-product/product-thumbnails.php @@ -1,7 +1,7 @@ $image_title, + $attributes = array( + 'title' => get_post_field( 'post_title', $attachment_id ), + 'data-caption' => get_post_field( 'post_excerpt', $attachment_id ), 'data-src' => $full_size_image[0], 'data-large_image' => $full_size_image[0], 'data-large_image_width' => $full_size_image[1], From 05bd3a0606efc2fa1a79114f525bedf34571bcdb Mon Sep 17 00:00:00 2001 From: Jason King Date: Thu, 29 Jun 2017 22:17:48 +0930 Subject: [PATCH 5/7] Woocommerce 3.1.0 Compatability --- woocommerce/single-product/rating.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/woocommerce/single-product/rating.php b/woocommerce/single-product/rating.php index b09056d..297111a 100644 --- a/woocommerce/single-product/rating.php +++ b/woocommerce/single-product/rating.php @@ -10,10 +10,10 @@ * 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 - * @package WooCommerce/Templates - * @version 2.3.2 + * @see https://docs.woocommerce.com/document/template-structure/ + * @author WooThemes + * @package WooCommerce/Templates + * @version 3.1.0 */ if ( ! defined( 'ABSPATH' ) ) { @@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) { global $product; -if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' ) { +if ( 'no' === get_option( 'woocommerce_enable_review_rating' ) ) { return; } @@ -32,14 +32,9 @@ $average = $product->get_average_rating(); if ( $rating_count > 0 ) : ?> -
-
- - ', '' ); ?> - ' . $rating_count . '' ); ?> - -
- (' . $review_count . '' ); ?>) + From 6d429df69858dbcd5ad819933acbd644bbc15b7a Mon Sep 17 00:00:00 2001 From: Jason King Date: Thu, 29 Jun 2017 22:19:15 +0930 Subject: [PATCH 6/7] Woocommerce 3.1.0 Compatability --- woocommerce/single-product/review-rating.php | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/woocommerce/single-product/review-rating.php b/woocommerce/single-product/review-rating.php index c95faf9..2fcdf28 100644 --- a/woocommerce/single-product/review-rating.php +++ b/woocommerce/single-product/review-rating.php @@ -1,8 +1,8 @@ comment_ID, 'rating', true ) ); -if ( $rating && get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) { ?> - -
- ' . $rating . '' ); - ?> -
- - Date: Thu, 29 Jun 2017 22:25:39 +0930 Subject: [PATCH 7/7] Use understrap text domain instead of woocommerce. --- woocommerce/cart/cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woocommerce/cart/cart.php b/woocommerce/cart/cart.php index 0b9a981..3a047b5 100644 --- a/woocommerce/cart/cart.php +++ b/woocommerce/cart/cart.php @@ -88,7 +88,7 @@ do_action( 'woocommerce_before_cart' ); ?> // Backorder notification if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) { - echo '

' . esc_html__( 'Available on backorder', 'woocommerce' ) . '

'; + echo '

' . esc_html__( 'Available on backorder', 'understrap' ) . '

'; } ?>