• Resolved couscousdelight

    (@couscousdelight)


    Hi,
    I’d like to thank you again to your work and support.

    I’m using this plugin mostly to display woocommerce products in widgets/pages.

    It works fine, but a extra feature could make it better, i guess.

    When i display a Product gallery or carousel, i use the taxonomies to select my images, like “product categories”.
    The thing is, it could be interesting to have IN, OR & NOT IN operators to display products when multiple categories are selected, to filter the results with more precision.

    I’ll buy a licence for shortcode creator to see if i can do something like that by myself, but i think it could be a nice feature for your plugin.

    Best regards,
    Arnaud

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Vova

    (@gn_themes)

    Hi Arnaud,

    thank you for the suggestion, I’ll see what I can do.

    Currently, you can fine-tune your queries using the su/get_gallery_slides_query filter. The following snippet (added to the functions.php file) will add the AND operator to your taxonomy queries:

    add_filter( 'su/get_gallery_slides_query', function( $query, $source, $args ) {
    
    	if ( ! isset( $query['tax_query'][0] ) ) {
    		return $query;
    	}
    
    	$query['tax_query'][0]['operator'] = 'AND';
    
    	return $query;
    
    }, 10, 3 );
    

    This filter will only work for Image Carousel shortcode.

    Thread Starter couscousdelight

    (@couscousdelight)

    Wow, thank you very much Vladimir, this is great support !

    I’ll try the code you gave.

    Best regards,
    Arnaud

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Feature Request : IN, NOT IN & AND operators’ is closed to new replies.