Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Woocommerce filter setup? › Reply To: Woocommerce filter setup?
So can I use Advanced Custom Fields On the subsite stores for the attributes so they can be filtered?
Very likely. If the field name does not show up in the filter input on the backend, you can still use it, it does not have to be found. In fact you can enter anything into that input, the plugin will still use it.
The category restriction might be doable as well, but only programmatically:
add_filter("asp_query_args", "asp_query_args_change", 10, 2);
function asp_query_args_change($args, $search_id) {
$args['post_tax_filter'] = array(
array(
'taxonomy' => 'product_cat',
'include' => array(1, 2, 3),
'exclude' => array(),
'allow_empty' => false // Don't allow results, which does not have connection with this taxonomy
)
);
return $args;
}
The code above will restrict the results to categories 1, 2 and 3 from the product_cat taxonomy. Change that to the category IDs you need from the subsite.
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.