wc_product_pre_has_unique_sku

wc_product_pre_has_unique_sku

Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.9.5

apply_filters('wc_product_pre_has_unique_sku') is found 1 times:

  • /includes/wc-product-functions.php line 757
    	 * @param bool|null $has_unique_sku Set to a boolean value to short-circuit the default SKU check.
    	 * @param int $product_id The ID of the current product.
    	 * @param string $sku The SKU to check for uniqueness.
    	 */
    	$has_unique_sku = apply_filters( 'wc_product_pre_has_unique_sku', null, $product_id, $sku );
    	if ( ! is_null( $has_unique_sku ) ) {
    		return boolval( $has_unique_sku );
    	}
    
    	$data_store = WC_Data_Store::load( 'product' );
    	$sku_found  = $data_store->is_existing_sku( $product_id, $sku );