propertyhive / WP-Property-Hive

The complete estate agency software plugin for WordPress
Other
27 stars 27 forks source link

Commercial property type price not searchable #118

Closed brynnroom57 closed 4 years ago

brynnroom57 commented 4 years ago

Is there a way to make the price of a commercial property searchable in the frontend form?

propertyhive commented 4 years ago

Hi Brynn,

Not at present I'm afraid. There are a few complications regarding searching for price on commercial properties. Namely:

Having looked at few large commercial agents (Knight Frank, Savills, Brown & Co etc) these don't have price filtering on their commercial property searches either, I wonder if it's due to the points mentioned above, or maybe it's because filtering by floor area and property type takes precedence over price.

I'm open to suggestions on the above points by the way, but it needs to be a solution that works for everyone.

Do let me know your thoughts.

Steve

brynnroom57 commented 4 years ago

In this scenario, the client is selling (selling only and not letting) small businesses, rather than premises and as such the units aren't used. I just need to query the commercial price form field in the front end form.

brynnroom57 commented 4 years ago

Hi Steve have you had any thoughts on this? It's pretty much site breaking for us right now. See rightmove, onthemarket and zoopla commercial sides all have price searchable, which are all portals we're sending to with the rtdf plugins and why we moved over to propertyhive.

Cheers

propertyhive commented 4 years ago

Hi Brynn,

Apologies for the delay I've been playing with this and am in the middle of putting together some custom code which you'll be able to drop into your functions.php file to make this work. I'm putting the finishing touches to this now and will send it through in the next couple of hours along with instructions,

Steve

propertyhive commented 4 years ago

Hi Brynn,

All done. Made a little more complicated by the fact commercial properties can have a price from and to range. Here's the code to drop into your functions.php:

https://gist.github.com/propertyhive/a5b6b45ab08b9f272715c6fa45fe5418

You'll also need to set it so the price dropdowns show in the search forms (if you havent' already). To do this, if you're using our free Template Assistant add on, you can:

i) Navigate to 'Property Hive > Settings > template Assistant > Search Forms' ii) Edit the search form in question iii) Expand the price fields. iv) You'll see a 'before' field which is a div containing a class. One of the classes is 'sales-only'. v) Add the class 'commercial-only' as well. Repeat for min and max price fields.

Give that a go and let me know how you get on. If any issues, if you can provide a link to the site I'll take a look.

Thanks, Steve