woocommerce_checkout_redirect_empty_cart filter-hookWC 1.0

When on the checkout with an empty cart, redirect to cart page.

Usage

add_filter( 'woocommerce_checkout_redirect_empty_cart', 'wp_kama_woocommerce_checkout_redirect_empty_cart_filter' );

/**
 * Function for `woocommerce_checkout_redirect_empty_cart` filter-hook.
 * 
 * @param  $true 
 *
 * @return 
 */
function wp_kama_woocommerce_checkout_redirect_empty_cart_filter( $true ){

	// filter...
	return $true;
}
$true
-

Where the hook is called

wc_template_redirect()
woocommerce_checkout_redirect_empty_cart
WC_Shortcode_Checkout::checkout()
woocommerce_checkout_redirect_empty_cart
woocommerce/includes/wc-template-functions.php 30
if ( is_page( wc_get_page_id( 'checkout' ) ) && wc_get_page_id( 'checkout' ) !== wc_get_page_id( 'cart' ) && WC()->cart->is_empty() && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) && ! is_customize_preview() && apply_filters( 'woocommerce_checkout_redirect_empty_cart', true ) ) {
woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php 287
if ( WC()->cart->is_empty() && ! is_customize_preview() && apply_filters( 'woocommerce_checkout_redirect_empty_cart', true ) ) {

Where the hook is used in WooCommerce

Usage not found.