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 ) : ?>

diff --git a/woocommerce/cart/cart.php b/woocommerce/cart/cart.php index aa5ccc4..3a047b5 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', 'understrap' ) . '

'; + } + ?> + - - 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' ); ?> - + - - - - - - - - - + + + + + + +
- - - +
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->get_cart_subtotal(); ?>

+

: cart->get_cart_subtotal(); ?>

-

- - -

+

+ + + +

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], 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 . '' ); ?>) + 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 . '' ); - ?> -
- -