woocommerce_add_to_cart_redirect filter-hookWC 1.0

If we added the product to the cart we can now optionally do a redirect.

Usage

add_filter( 'woocommerce_add_to_cart_redirect', 'wp_kama_woocommerce_add_to_cart_redirect_filter', 10, 2 );

/**
 * Function for `woocommerce_add_to_cart_redirect` filter-hook.
 * 
 * @param  $url            
 * @param  $adding_to_cart 
 *
 * @return 
 */
function wp_kama_woocommerce_add_to_cart_redirect_filter( $url, $adding_to_cart ){

	// filter...
	return $url;
}
$url
-
$adding_to_cart
-

Where the hook is called

WC_Form_Handler::add_to_cart_action()
woocommerce_add_to_cart_redirect
WC_Frontend_Scripts::get_script_data()
woocommerce_add_to_cart_redirect
woocommerce/includes/class-wc-form-handler.php 801
$url = apply_filters( 'woocommerce_add_to_cart_redirect', $url, $adding_to_cart );
woocommerce/includes/class-wc-frontend-scripts.php 579
'cart_url'                => apply_filters( 'woocommerce_add_to_cart_redirect', wc_get_cart_url(), null ),

Where the hook is used in WooCommerce

Usage not found.