Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Minimal Character and Default Result
This topic contains 23 replies, has 2 voices, and was last updated by Ernest Marcinko 5 years, 9 months ago.
- AuthorPosts
- March 10, 2018 at 8:26 pm #17083
Hi,
Thanks for answering all my pre-sales questions. I was excited to purchase based on the information provided. I however need some help – see below:1) The Minimal Character count to trigger works on PCs but not on mobile versions. Please check. See attached for the section I’m referring to.
2) I’m trying to use the tool to search for Agents. Is there a way i can set a default Agent to be displayed if no result is found? For instance, if there is no agent for the particular location, display a specified Agent.Many thanks
FemiMarch 12, 2018 at 2:11 pm #17092Hi Femi,
Thank you for the proper details, it helps me a lot 🙂
1. On the General Options -> Mobile behavior panel the Trigger for mobile devices option was turned off. I have enabled it, now it should work after clearing your front-end cache.
2. Well, there is not really an option for that, but it might be possible with a custom code. I have constructed a script, which will execute after the search process is completed, and if there are no results, it will execute another query to get the items as defined.
Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!
Change the $ids array to the item ID (or comma separated post IDs if more), and it should do the trick. Let me know if you need help with this.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 22, 2018 at 9:49 pm #17234You cannot access this content.March 23, 2018 at 11:56 am #17239Hi!
I think the $ids variable has to be an array of IDs, not a single id. So instead of this line:
$ids = 247;
it should be this:
Best,$ids = array(247);
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 26, 2018 at 11:47 pm #17290Hi Ernest,
That’s what i tried at the onset but still not working.
$ids = array(247); // Ids of posts/pages/cptDo i need to make any adjustments in the settings section?
Thanks
FemiMarch 27, 2018 at 10:09 am #17298Hi Femi,
Does it give any error messages, or just simply displays no results? Strangely this works on my test environment, so it might be related to a specific configuration, but I’m not sure.
If you want, you can add temporary FTP details, and I can try to debug it on your server directly.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 27, 2018 at 11:04 am #17306Hi Ernest,
It just does not come up with anything if the post code entered is not in the available list.The test site is hosted on a multi-site C-panel so i will need to arrange a temporary ftp account with the site owner.
I however think the issue will be within the context of the WordPress administration i.e. the plugin and how i have set it up. If its working for you, it may be the configuration i have used. Do you want to have a look at that? The log in details provided earlier is still functional.
thanks
FemiMarch 27, 2018 at 12:10 pm #17308Hi!
I managed to resolve it via the theme functions editor. It is not the safest method, but I was careful.
Adding an additional argument to the code solved the problem. For future reference, this is the final code:
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 27, 2018 at 12:26 pm #17309Hi Ernest
Excellent!!! Many thanks for that.I noticed though that it sometimes come up with an agent in addition to the default one. For instance, if you search for “wa7 3tu”, you get “Allan Melvin” and the default agent. It should work in such a way that you only get the valid agent or the default.
Thanks for your tenacity on this. You’ve made the installation of a key tool stress-free
Femi
March 27, 2018 at 12:46 pm #17310Hi,
The code does not affect succesful searches, it only executes if there are no results.
The search for ‘wa7 3tu’ shows the default agent as well, because it matches the ‘wa7’ keyword.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 27, 2018 at 1:00 pm #17312Hi Ernest,
Yes you are right. But if i take ‘wa7’ out of the default, it is no longer working when the post code is not valid.
Sorry to be a bother but quite keen to get this to work.
Thanks
FemiMarch 27, 2018 at 1:10 pm #17313Hi Femi,
Yes, indeed. It happened, because my previous fix relied on searching that field, and I just picked a random string that matched it. But since it was changed, it no longer matches.
I resolved it, by editing the custom code to look for a special string ‘_TEMPCODE_’, and I also added this string to the zip codes section of that agent, please don’t remove it: https://i.imgur.com/QdRQxm2.png
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 27, 2018 at 1:32 pm #17316Hi Ernest,
Perfect! I’ll test as soon as i can and let you know. I’m sure it will be ok (lol).
Thanks for your great help
FemiMay 14, 2018 at 5:55 pm #17853Hi Earnest,
I’ve come across another problem while testing. For instance if Agent A has a post code of M16 and Agent B has a post code of RM16, when i do a search using keyword “M16 xyz”, it retrieves the two Agents (I’m using Logic “OR”)What i want is for the tool to start the search from the beginning of the string “M….” such that only Agent A with post code of M16 is retrieved. Agent B with post code “RM16” should not be returned.
Many thanks for the help so far
Regards
FemiMay 15, 2018 at 9:57 am #17864Hi Femi,
In that case, I suggest trying the ‘OR with exact word matches’ logic, it will probably do the trick: https://i.imgur.com/pSfQJtP.png
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
The topic ‘Minimal Character and Default Result’ is closed to new replies.