woocommerce_redirect_single_search_result filter-hookWC 1.0

Redirect to the product page if we have a single product.

Usage

add_filter( 'woocommerce_redirect_single_search_result', 'wp_kama_woocommerce_redirect_single_search_result_filter' );

/**
 * Function for `woocommerce_redirect_single_search_result` filter-hook.
 * 
 * @param  $true 
 *
 * @return 
 */
function wp_kama_woocommerce_redirect_single_search_result_filter( $true ){

	// filter...
	return $true;
}
$true
-

Where the hook is called

wc_template_redirect()
woocommerce_redirect_single_search_result
woocommerce/includes/wc-template-functions.php 58
if ( is_search() && is_post_type_archive( 'product' ) && apply_filters( 'woocommerce_redirect_single_search_result', true ) && 1 === absint( $wp_query->found_posts ) ) {

Where the hook is used in WooCommerce

Usage not found.