Bump template version and move to correct function files.

This commit is contained in:
Mike Jolley 2017-04-26 13:25:14 +01:00
parent c6bc8f7836
commit 13bc235020
4 changed files with 16 additions and 19 deletions

View File

@ -40,20 +40,6 @@ function wc_empty_cart() {
WC()->cart->empty_cart( false );
}
/**
* Show notice if cart is empty.
*
* @since 3.1.0
*/
function wc_empty_cart_message() {
?>
<p class="cart-empty">
<?php echo apply_filters( 'wc_empty_cart_message', __( 'Your cart is currently empty.', 'woocommerce' ) ); ?>
</p>
<?php
}
add_action( 'woocommerce_cart_is_empty', 'wc_empty_cart_message', 10 );
/**
* Load the persistent cart.
*

View File

@ -2570,3 +2570,12 @@ function wc_logout_url( $redirect = '' ) {
return wp_logout_url( $redirect );
}
}
/**
* Show notice if cart is empty.
*
* @since 3.1.0
*/
function wc_empty_cart_message() {
echo '<p class="cart-empty">' . apply_filters( 'wc_empty_cart_message', __( 'Your cart is currently empty.', 'woocommerce' ) ) . '</p>';
}

View File

@ -228,6 +228,7 @@ add_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shop
add_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
add_action( 'woocommerce_cart_collaterals', 'woocommerce_cart_totals', 10 );
add_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 );
add_action( 'woocommerce_cart_is_empty', 'wc_empty_cart_message', 10 );
/**
* Footer.

View File

@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
* @version 3.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -22,11 +22,12 @@ if ( ! defined( 'ABSPATH' ) ) {
wc_print_notices();
?>
/**
* @hooked wc_empty_cart_message - 10
*/
do_action( 'woocommerce_cart_is_empty' );
<?php do_action( 'woocommerce_cart_is_empty' ); ?>
<?php if ( wc_get_page_id( 'shop' ) > 0 ) : ?>
if ( wc_get_page_id( 'shop' ) > 0 ) : ?>
<p class="return-to-shop">
<a class="button wc-backward" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ) ); ?>">
<?php _e( 'Return to shop', 'woocommerce' ) ?>