Quote from Francisco Javier on January 5, 2021, 01:52
Hello,
Unfortunately currently I'm using the plugin with another plugin to sort the products that nowadays is not working with [products] shortcode but yes with your shortcode [woof_products] I don't no why...
Could I filter with javascript the products with your filter woof_products_query?
I've tried something like this:
apply_filters('woof_products_query', 'filtro_refrigerados');
function filtro_refrigerados() {
$query = new WP_Query( array( 'tag__not_in' => array( 122323 ) ) );
return $query;
}
But it's not working and also tried with custom_pre_get_posts_query like:
function custom_pre_get_posts_query( $q ) {
$tax_query = (array) $q->get( 'tax_query' );
$tax_query[] = array(
'taxonomy' => 'product_tag',
'field' => 'slug',
'terms' => array( 'banana' ), // Don't display products with the tag "banana"
'operator' => 'NOT IN'
);
$q->set( 'tax_query', $tax_query );
}
add_action( 'woocommerce_product_query', 'custom_pre_get_posts_query' );
But doesn't works either, could you help me?
Hello,
Unfortunately currently I'm using the plugin with another plugin to sort the products that nowadays is not working with [products] shortcode but yes with your shortcode [woof_products] I don't no why...
Could I filter with javascript the products with your filter woof_products_query?
I've tried something like this:
apply_filters('woof_products_query', 'filtro_refrigerados');
function filtro_refrigerados() {
$query = new WP_Query( array( 'tag__not_in' => array( 122323 ) ) );
return $query;
}
But it's not working and also tried with custom_pre_get_posts_query like:
function custom_pre_get_posts_query( $q ) {
$tax_query = (array) $q->get( 'tax_query' );
$tax_query[] = array(
'taxonomy' => 'product_tag',
'field' => 'slug',
'terms' => array( 'banana' ), // Don't display products with the tag"banana"
'operator' => 'NOT IN'
);
$q->set( 'tax_query', $tax_query );
}
add_action( 'woocommerce_product_query', 'custom_pre_get_posts_query' );
But doesn't works either, could you help me?