woocommerce_checkout_redirect_empty_cart
Использование
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
- -
Где вызывается хук
woocommerce_checkout_redirect_empty_cart
woocommerce_checkout_redirect_empty_cart
woocommerce/includes/wc-template-functions.php 31
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 346
if ( WC()->cart->is_empty() && ! is_customize_preview() && apply_filters( 'woocommerce_checkout_redirect_empty_cart', true ) ) {