woocommerce_customer_bought_product_use_lookup_tables filter-hookWC 9.7.0

Whether to use lookup tables - it can optimize performance, but correctness depends on the frequency of the AS job.

Usage

add_filter( 'woocommerce_customer_bought_product_use_lookup_tables', 'wp_kama_woocommerce_customer_bought_product_use_lookup_tables_filter', 10, 4 );

/**
 * Function for `woocommerce_customer_bought_product_use_lookup_tables` filter-hook.
 * 
 * @param bool   $enabled        
 * @param string $customer_email Customer email to check.
 * @param int    $user_id        User ID to check.
 * @param int    $product_id     Product ID to check.
 *
 * @return bool
 */
function wp_kama_woocommerce_customer_bought_product_use_lookup_tables_filter( $enabled, $customer_email, $user_id, $product_id ){

	// filter...
	return $enabled;
}
$enabled(true|false)
-
$customer_email(string)
Customer email to check.
$user_id(int)
User ID to check.
$product_id(int)
Product ID to check.

Changelog

Since 9.7.0 Introduced.

Where the hook is called

wc_customer_bought_product()
woocommerce_customer_bought_product_use_lookup_tables
woocommerce/includes/wc-user-functions.php 425
$use_lookup_tables = apply_filters( 'woocommerce_customer_bought_product_use_lookup_tables', false, $customer_email, $user_id, $product_id );

Where the hook is used in WooCommerce

Usage not found.