woocommerce_checkout_redirect_empty_cart
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
woocommerce_checkout_redirect_empty_cart
woocommerce_checkout_redirect_empty_cart
woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php 344
if ( WC()->cart->is_empty() && ! is_customize_preview() && apply_filters( 'woocommerce_checkout_redirect_empty_cart', true ) ) {
woocommerce/includes/wc-template-functions.php 40
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 ) ) {