Hi,
I’ve fixed the first problem (Location Auto Complete). I hadn’t set the default Ads Listing page correctly.
Still struggling with the second though, i.e. how to add additional search criteria. I can modify the search form using the Custom Fields ad-on but the new fields don’t take effect in the actual search.
Hi,
One of the search criteria I want to add is Price and I’ve just discovered the code snippet for Search by Price which is very helpful. This gives me just about all I need on Price search but I’ve one request. Can I make the Price Min / Price Max fields drop downs with pre-defined selections?
If I can do this the only additional search criteria I want to add relates to one of my custom fields ‘Number of Bedrooms’. I’ve defined this as a field called ‘bedroom_count’ available for both of my categories Buyer & Seller.
Thanks,
You can make the Price Min and Max fields drop-down when configuring the search using Custom Fields extension if you already have this add-on you should not use the Search By Price snippet.
As for the search not working, how do you have the search fields configured in wp-admin / Classifieds / Options / Custom Fields panel? Can you send some screenshot from the price and bedroom configuration?
Thanks Greg,
I’ve deactivated the snippet and used the Custom Fields for Max and Min Price. All working fine as a drop down – thanks! The search by bedroom seems to be working ok too. Just leaves me with these Search Field related questions:
1. When I enter a search selection it reverts to the default (if drop down then first option) after hitting ‘Search’. Any way to make the search selection stick? E.g. if selecting 3 Bedrooms this sticks after the Search button hit? Just helps the user know what search option they selected.
2. The Location Field works with a Radius field. I can’t seem to show them next to each other though when I add new custom fields. Radius is always at the end of the custom fields I add to the search form. How can I keep Radius next to Location? ( see page https://moovrmatch.co.uk/adverts/)
That’s it for Search set up. I’ve one more question on Ad Listing layout but I’ll ask in a different topic.
Thanks,
Richard.
…sorry Greg, spoke too soon. Search by price isn’t working. Location is, my other custom field is (bedroom_count) but not price. It did when using the code snippet but not using the custom fields add in for creating Max and Min price.
I can’t see how to add a screen shot here but the Custom Fields settings I made are:
Max Choices – 1
Fill Method – I will enter options myself
Values for drop down £100,000 – £1000,000 with ‘£’ and ‘,’ characters
Search by Price
Match if Greater Than for Equal to for Min, Less than or Equal to for Max
You can post the image on some other site like https://imgur.com/ and link to the page here.
Either way, i am looking at your search form right now and it looks like the problem is that when configuring options for min and max price fields you are using texts only.
While editing the Min Price (or Max Price) field, below the options list check “use values” checkbox, then in the “value” field an integer number.
For example, the text for your first option is “£100,000” so the label should be “100000”, similarly with other options.
Thanks Greg,
That works. I should explain the only reason I tried using £xxx,xxx format was because I was running the Code Snippet Max / Min fields with the Custom Fields initially and I noticed the Code Snippet fields seemed to correctly interpret £xxx,xxx.
Can I get my Search drop down Max/Min boxes to work in a similar way to the Price field on the Ad Details forms which have the option to ‘convert string formatted as price to float?
Also any help getting the Location and Radius fields to stay together would be great. Radius always moves to the end of a form.
Thanks,
Richard.
…just realised the if I always put Location at the end of my Search box, Radius always appears next to it. This is fine. No big deal.
My main issue is the Price formatting. Would be great for the drop down to have £x,xxx,xxx or at least x,xxx,xxx.
Thanks
Using the price fields in the search form the same way as in [adverts_add] is not really possible as the search form is not being validated so there is no place to run a filter which would convert the search string back to an integer.
In other words with the normal text field and enabled price formatting the result would be exactly the same when using the dropdowns without the “values” entered.