woocommerce_cart_redirect_after_error хук-фильтрWC 1.0

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

Использование

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
-

Где вызывается хук

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

Где используется хук в WooCommerce

Использование не найдено.