Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter darkallman

    (@darkallman)

    For now I have changed class-ysm-search.php

    	protected static function get_suggestions($posts)
    	{
    		$sep_exclude = get_option( 'sep_exclude', array() );
    		
    		foreach ($posts as $post) {
    			
    			
    			if(in_array($post->ID,$sep_exclude)){
    				continue;
    			}
    ....
    ....
    • This reply was modified 8 years, 8 months ago by darkallman.
    Plugin Contributor pronskiy

    (@pronskiy)

    Hi @darkallman,

    Another possible solution is adding following snippet to the functions.php file:

    
    function smart_search_query_where_filter( $where ) {
        $sep_exclude = implode(',', get_option( 'sep_exclude', array() ));
        $condition = sprintf('p.ID NOT IN (%s)', $sep_exclude);
        $where['and'][] = $condition;
    
        return $where;
    }
    add_filter( 'smart_search_query_where', 'smart_search_query_where_filter' );
    
    Thread Starter darkallman

    (@darkallman)

    Thanks for this update. Implemented it now.
    Is there a similar way to do this for groups hidden products?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Smart Woocommerce Search’ is closed to new replies.