Forums Forums Search & Filter Pro Selectbox menu

Viewing 5 posts - 11 through 15 (of 15 total)
  • Trevor
    #239979

    Where did you place the CSS?

    Anonymous
    #240004

    Hello

    please see this image
    https://ibb.co/HVM82Mj

    Thank you

    Trevor
    #240009

    I don’t see this CSS in there:

    .sf-level-2 { display: none; }
    .sf-level-0 { display: none; }

    Which should be:

    .searchandfilter[data-sf-form-id="157762"] > ul > li.sf-field-taxonomy-destination .sf-level-2,
    .searchandfilter[data-sf-form-id="157762"] > ul > li.sf-field-taxonomy-destination .sf-level-0 {
      display: none;
    }

    But, I understand why it does not sort now. You are keeping only level 1. But they are still sorted under level 0, then level 1.

    Anonymous
    #240011

    Hello
    I don’t know why don’t see my code, it was :

    .sf-field-taxonomy-destination .sf-level-2 { display: none; }
    .sf-field-taxonomy-destination .sf-level-0 { display: none; }

    Now, I changed with your code :

    .searchandfilter[data-sf-form-id=”157762″] > ul > li.sf-field-taxonomy-destination .sf-level-2,
    .searchandfilter[data-sf-form-id=”157762″] > ul > li.sf-field-taxonomy-destination .sf-level-0 {
    display: none;
    }

    As i understand we can’t sort them directly by level 1?

    Thank you

    Trevor
    #240014

    It MIGHT be possible, but only with custom code (I don’t know what this would be though), using this filter:

    https://searchandfilter.com/documentation/action-filter-reference/#filter-input-object

    In code similar to this (in the child theme functions.php file):

    function filter_input_destination($input_object, $sfid)
    {
    	 
    	if(($input_object['name']!='_sft_destination')||($input_object['type']!='select'))
    	{
    		return $input_object;
    	}
    	
    	
    	if(!isset($input_object['options']))
    	{
    		return $input_object;
    	}
    	
    	
    	// sort the array here, using PHP array_multisort() function.
    		
    	return $input_object;
    }
    
    add_filter('sf_input_object_pre', 'filter_input_destination', 10, 2);

    And I would guess make sure it is the correct form ID.

Viewing 5 posts - 11 through 15 (of 15 total)