Searchable Price Range
-
I am working with Agentpress Pro and Agentpress Listings. I am importing listing using a import plugin. Therefore I am not touching each listing to click the checkmark for the “Price Range” taxonomy” I am looking for a way to automatically figure from the imported data which taxonomy it would go in with IF else conditionals.
I am no programmer and relatively new to Genesis but have been told I can use something like below in the functions.php in order to accomplish this. Also it would seem this could be beneficial to search for a range in bedrooms too. Instead of a static 4 bedrooms, the search could show all 4 – 6 bedroom listings. Am I over simplifying what is possible to do?
function price_range($_listing_price_sortable) {<br /> if($_listing_price_sortable>1 and $_listing_price_sortable <100000){<br /> $range = "$10K - $100K";}<br /> else if($listing-price>10000 and $_listing_price <150000){<br /> $range = "$100000K - $150000K";}<br /> else if($_listing_price>150000 and $_listing_price <175000){<br /> $range = "$150K - $175K";}<br /> else if($_listing_price>175000 and $_listing_price <200000){<br /> $range = "$175K - $200K";}<br /> else if($_listing_price>200000 and $_listing_price <225000){<br /> $range = "$200K - $225K";}<br /> else if($_listing_price>225000 and $_listing_price <250000){<br /> $range = "$225K - $250K";}<br /> else if($_listing_price>250000 and $_listing_price <275000){<br /> $range = "$250K - $275K";}<br /> else if($_listing_price>275000 and $_listing_price <300000){<br /> $range = "$275K - $300K";}<br /> else if($_listing_price>300000 and $_listing_price <325000){<br /> $range = "$300K - $325K";}<br /> else if($_listing_price>325000 and $_listing_price <350000){<br /> $range = "$325K - $350K";}<br /> else if($_listing_price>350000 and $_listing_price <375000){<br /> $range = "$350K - $375K";}<br /> else if($_listing_price>375000 and $_listing_price_sortable <400000){<br /> $range = "$375K - $400K";}<br /> else {<br /> $range = "No Range";}<br /> return $range;<br />
- The topic ‘Searchable Price Range’ is closed to new replies.