woocommerce_cart_redirect_after_error filter-hookWC 1.0

If there was an error adding to the cart, redirect to the product page to show any errors.

Usage

add_filter( 'woocommerce_cart_redirect_after_error', 'wp_kama_woocommerce_cart_redirect_after_error_filter', 10, 2 );

/**
 * Function for `woocommerce_cart_redirect_after_error` filter-hook.
 * 
 * @param  $permalink  
 * @param  $product_id 
 *
 * @return 
 */
function wp_kama_woocommerce_cart_redirect_after_error_filter( $permalink, $product_id ){

	// filter...
	return $permalink;
}
$permalink
-
$product_id
-

Where the hook is called

WC_AJAX::add_to_cart()
woocommerce_cart_redirect_after_error
woocommerce/includes/class-wc-ajax.php 432
'product_url' => apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ),

Where the hook is used in WooCommerce

Usage not found.