Search properties
Permalink Browser Info Environment
How to enable search which is mean in specs:
search by price range or can be taylored to search by any Properties attribute?
I didn't find it anywhere.
search by price range or can be taylored to search by any Properties attribute?
I didn't find it anywhere.
Type: | Discussion |
---|---|
Status: | In Progress |
I see it only in Dashboard but in specs says: that it is avaliable in SINGLE PAGES
Are you asking how to enable a "search by price range" on the default listing page?
Yes, and how to change search in other properties like min sqrft and max sqrft too.
There is a default search form on the single_pages/listings/view.php for the 'default' case (search the file for 'sorting_sidbar' and you'll find the start of the HTML that defines it.
You can add more fields in here to match them to filter methods in the model ... check out the view() method in controllers/listings/controller.php, around line 97 you should see the block that pulls everything out of the 'post_filters' session variable.
You can add more fields in here to match them to filter methods in the model ... check out the view() method in controllers/listings/controller.php, around line 97 you should see the block that pulls everything out of the 'post_filters' session variable.
Hi,
whatever I type in the location indicated by You, I still search the price not the sqrft. For example, I type
replacing there price1 to sqrft1 but it's not working well. Still see price field.
It is for me very complicated. Can I ask for clarification of code or script file to enter the sqrft field in search fields to get an extra parameter search on the surface?
Let me remind you that the purchasing module mainly suggested the possibility of changing or adding search boxes as it is in description, quote:
search by price range or can be taylored to search by any Properties attribute.
whatever I type in the location indicated by You, I still search the price not the sqrft. For example, I type
replacing there price1 to sqrft1 but it's not working well. Still see price field.
It is for me very complicated. Can I ask for clarification of code or script file to enter the sqrft field in search fields to get an extra parameter search on the surface?
Let me remind you that the purchasing module mainly suggested the possibility of changing or adding search boxes as it is in description, quote:
search by price range or can be taylored to search by any Properties attribute.
Changes made to controllers/listings/controller.php
Added function to models/property_list.php
And finally, changes to single_pages/listings/view.php
if($key=='price1_filter'){ $kpl->filterByPrice($_SESSION['post_filters']['price1_filter'],$_SESSION['post_filters']['price2_filter']); } elseif ($key == 'sqrft1_filter') { $kpl->filterBySqrft($_SESSION['post_filters']['sqrft1_filter'],$_SESSION['post_filters']['sqrft2_filter']); }elseif(!in_array($key,array('sqrft2_filter','price2_filter'))){ $qu = 'filterBy'.ucfirst($key); $kpl->$qu($value); }
Added function to models/property_list.php
And finally, changes to single_pages/listings/view.php
Thank You very much! Now it's working, You're great, but can You make choice for implementing system-level editing, so that you can choose a field to search? It could be very helpful.
I have a last problem: I want to insert the search block on every page and not only the listing search which is visible in page map. Why is not created a block search, can you tell me what code to write and where to insert? I would be very keen on this, so I can decide for myself where to insert search bar.
You could add these options described in the next version of Properties... :)
I have a last problem: I want to insert the search block on every page and not only the listing search which is visible in page map. Why is not created a block search, can you tell me what code to write and where to insert? I would be very keen on this, so I can decide for myself where to insert search bar.
You could add these options described in the next version of Properties... :)