Low Search "range-from" and "range:to" (grid) not working
Hi Low,
I'm having some issues with my Low Search implementation for a real estate website. I have the following fields:
> Keywords
> Bedrooms
> Bathrooms
> Minimum Price (not working)
> Maximum Price (not working)
The issue I am having relates specifically to the min-price (grid) and max-price (grid). Below is the snippet of the min/max fields:
<div class="col-md-4">
<label for="minprice">Minimum price</label>
<select name="range-from:p_price_options:price" id="minprice" class="form-control">
<option value="">$0</option>
<option value="100000">$100,000</option>
<option value="200000">$200,000</option>
<option value="300000">$300,000</option>
<option value="400000">$400,000</option>
<option value="500000">$500,000</option>
<option value="600000">$600,000</option>
<option value="700000">$700,000</option>
</select>
</div>
<div class="col-md-4">
<label for="maxprice">Maximum price</label>
<select name="range-to:p_price_options:price" id="maxprice" class="form-control">
<option value="">No Max Price</option>
<option value="200000">$200,000</option>
<option value="300000">$300,000</option>
<option value="400000">$400,000</option>
<option value="500000">$500,000</option>
<option value="600000">$600,000</option>
<option value="700000">$700,000</option>
<option value="800000">$800,000</option>
<option value="900000">$900,000</option>
<option value="1000000">$1,000,000</option>
</select>
</div>
Due to the variety of property prices, I've structured my grid field in the following way:
{p_price_options}
{p_price_options:text_before}
{p_price_options:price}
{p_price_options:price_alternative}
{p_price_options:text_after}
{/p_price_options}
Based on your docs (http://gotolow.com/addons/low-search/...), I can't see what I am doing wrong but when I perform the search the min and max-prices don't take full effect. Eg. Rentals at $400 a week return when min-price is set to $100,000 and $1 million properties display when a max-price is set to $500,000.
An example of my Grid range set-up that does work is the Bed & Bath options but this isn't using the "range-to" and "range-from":
<div class="col-md-4">
<label for="sf_beds">Bedrooms</label>
<select name="range:p_bed_bath_car:beds" id="sf_beds" class="form-control">
<option value="">All</option>
<option value="1|9">1+</option>
<option value="2|9">2+</option>
<option value="3|9">3+</option>
<option value="4|9">4+</option>
<option value="5|9">5+</option>
<option value="6|9">6+</option>
</select>
</div>
<div class="col-md-4">
<label for="sf_baths">Bathrooms</label>
<select name="range:p_bed_bath_car:bathrooms" id="sf_baths" class="form-control">
<option value="">All</option>
<option value="1|9">1+</option>
<option value="2|9">2+</option>
<option value="3|9">3+</option>
<option value="4|9">4+</option>
<option value="5|9">5+</option>
<option value="6|9">6+</option>
</select>
</div>
Grid fields:
{p_bed_bath_car}
{p_bed_bath_car:beds}
{p_bed_bath_car:bathrooms}
{p_bed_bath_car:cars}
{/p_bed_bath_car}
When I first implemented it, it appeared to work but now we're close to go live (Oct 1 AEST I've noticed it's not functioning correctly. The site is still is soft-dev so it's in lock down but I've taken a short recording of the search in action for you to see:
http://screencast.com/t/0vezIa9dZvYt
Any assistance would be greatly appreciated. I hope to hear back from you soon!
Thanks,
Dan
Replies
Dan Treasure 29 Sep 2015 12:31
Hey Low... Guess what... It looks as though I have solved my problem...
Classic amateur mistake - I was re-reading your docs and got to your example for ranges where I noticed your note:
So I went back and checked the field content property and Low and behold it was set to "All".
Changes this to "Number" appears to have resolved the min/max price filter!
Thanks for listening and for all your awesome plugins!
Cheers,
Dan
P.S. I wish you had "facepalm" as an icon!
Low 29 Sep 2015 12:47
Was about to suggest just that! Will add that note to the Ranges Filter docs, too.