Make page builders and custom template filterable
To make custom template compatible with WOOF add next code to the current WordPress child-theme file functions.php:
//Make the Husky product filter work with page builder layouts
add_action('pre_get_posts', function ($query) {
if (is_object($query) AND isset($query->query['post_type'])) {
if ($query->query['post_type'] === 'product' /* AND is_page(1867) */) {
if (isset($query->query['wc_query']) AND 'product_query' == $query->query['wc_query']) {
return $query;
}
global $WOOF;
if (is_object($WOOF) AND !empty(woof()->get_request_data())) {
woof()->woof_products_ids_prediction(['per_page'=>99999]);
$query->query_vars['post__in'] = $_REQUEST['woof_wp_query_ids'];
}
}
}
return $query;
});
Troubles? Ask for Support!
