Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.