Last active
May 23, 2020 05:37
-
-
Save plugin-republic/70890d4a5036d9ed7569d6a268d8261d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter which product type is used in the Products field | |
* @param $product_type | |
* @param $product_id Product ID - use this to conditionally change product type per product | |
* @param $field_id Field ID - use this to conditionally change product type per field | |
*/ | |
function prefix_search_products( $product_type, $product_id, $field_id ) { | |
$product_type = 'woocommerce_json_search_products_and_variations'; // Allows you to include variations | |
// $product_type = 'variable_subscriptions'; // Include variations for subscriptions | |
return $product_type; | |
} | |
add_filter( 'pewc_filter_child_products_method', 'prefix_search_products', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment