woocommerce_cart_redirect_after_error

woocommerce_cart_redirect_after_error

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_cart_redirect_after_error') is found 1 times:

  • /includes/class-wc-ajax.php line 495
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
            // If there was an error adding to the cart, redirect to the product page to show any errors.
            $data = array(
                'error'       => true,
                'product_url' => apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ),
            );
     
            wp_send_json( $data );
        }
        // phpcs:enable
    }