Forums Forums Search & Filter Pro Make range filter work with only min value.

Tagged: 

Viewing 10 posts - 1 through 10 (of 16 total)
  • Anonymous
    #227459

    How to setup?

    i.e. property listing.
    number of bedroom:
    1+
    2+
    3+
    4+

    Trevor
    #227594

    You would have to make it with the max value also, but use Custom CSS to hide the TO field, and also use some Custom JavaScript to place a high value in the hidden field (e.g. 100).

    Anonymous
    #227610

    Really? When I set setting to min:1/max:10/step:1,
    it end up like this:

    1-2
    2-3
    3-4
    4-5

    Trevor
    #227620

    It would to be set something like this:

    https://www.screencast.com/t/9xqY9L1Kaa7

    And the custom css would be like this:

    .sf-field-post-meta-edd_price label:last-of-type,
    .sf-field-post-meta-edd_price span:last-of-type {
      display: none;
    }
    Anonymous
    #227622

    I mean,
    it should be like this.

    number of bedroom:
    1-100
    2-100
    3-100
    4-100

    Trevor
    #227629

    That we cannot do with the current plugin. It may well change with V3, but I cannot give you an ETA on that. For now the only workaround is as I have shown.

    Anonymous
    #227743

    I was able to modify the dropdown filter via a hook but it seems that the dropdown filter is not working even without using the hook in the first place.(return no result)
    Do you know why?

    fyi this is the function I used.

    function sf_input_object_pre_mod($input_object,$sfid){
      if($sfid==151){
    if($input_object['name']=='_sfm_property_bedroom'||$input_object['name']=='_sfm_property_bathroom'){
    	  $opts = $input_object['options'];
          foreach($opts as $ok=>$ov){
            $input_object['options'][$ok]->label = preg_replace('/ .+/','',$ov->label);
            $input_object['options'][$ok]->value = preg_replace('/\+.+/','+99',$ov->value);
          }
        }
      }
      return $input_object;
    }
    add_filter('sf_input_object_pre','sf_input_object_pre_mod',10,2);
    Anonymous
    #227745
    This reply has been marked as private.
    Trevor
    #227828
    This reply has been marked as private.
    Anonymous
    #227840
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 16 total)