• Hi,
    How can I remove all filter? In my search form I don’t need all filter.
    And How filter by category should be added? I added category ID to category list but It doesn’t work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter camelliagh

    (@camelliagh)

    Hi again,
    Can I make search form with just one filter?!

    Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    Sorry for the late response.
    You just need to go to plugin settings page -> ‘Search results’ tab and remove all filters except ‘All’ default filter.
    On front-end in this case there won’t be any filters tab.

    About filter by category – first of all choose ‘Filter relation’.
    Exclude – from search will be excluded all products with categories IDs from the specified list.
    Include – search will be perormed for products that belongs to categories from the specified list.

    Thread Starter camelliagh

    (@camelliagh)

    Hi again,
    In some pages I need to have a predefined filter. I want to search in just one category. I don’t need “All” filter. How can I remove that?!

    Plugin Author ILLID

    (@mihail-barinov)

    In this case there is two ways to do that:

    1. Create different search instances for every page where you need different search behavior. For this search instances you will need to set categories filter from plugin settings page.

    2. Use plugin filters. Its will require some coding skills from you.
    You need to add to your theme functions.php file code like that

    add_filter( 'aws_cats_filter', 'aws_cats_filter_update' );
    
    function aws_cats_filter_update( $cats ) {
        if ( get_queried_object_id() === 12 ) {
             $cats = $cats . ',' . 10;        
        }
        return $cats;
    }

    In this example we exclude category with id = 10 from search if uset is in page with id = 12.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove “all” filter’ is closed to new replies.