SWEEEEEEEET!!!! that sorted it right out. top notch!!!
Printable View
Nice one! that sorted my search out loads; there's still a few stragglers here and there but it's infinitely better! thanks man i really appreciate that!
I just performed the mod on my 1.3.9h store and it works great! I just need to do the additional modification to the mysql config file to account for the 3 letter words. Thanks for posting the code!
trying to add full text using phpmyadmin but it doesnt have that option, its grayed out. anyone else have this issue?
This trick also works on 1.57c. Thanks!
But I did notice that sometimes my screen will auto scroll down several rows. It only happens on my PC, not on my phone. I did some tests and it looked like that it is related to jscript_onload_helper.php under the same folder. I deleted that file and it worked properly. It doesn't generate any log files or warning.
This trick also works on zc1.58. Thanks!
But the file has been moved. This modification should be applied to the following file instead.
\includes\modules\pages\search_result\header_php.php
jscript_onload_helper.php file is gone as well. I cannot find this file and I cannot find function onloadFocus() in any files in zc1.58 now. I didn't notice the "auto scroll" issue I mentioned in my last post anyway.
Using Rob's full-search technique really improved the search results on our web site. I wrote a blog post a while back on how I implemented it for 1.5.7. I tweaked it a little for slightly better results and added a field so that you can specify additional text to search that isn't displayed to the customer:
https://jonrocket.com/zencart/2021/0...earch-results/
for anyone thinking about doing this, i think it is a MAJOR mistake. granted this is only my opinion, but still...
as the blog post says in it's preface:
"The method I describe here involves directly modifying Zen Cart core files. Generally, it isn’t a good idea to modify the core files of an application since it makes upgrading more difficult and error-prone...."
i agree with the preface that searching on zen-cart was not ideal... which is why there has been some MASSIVE overhaul of said searching in v158. i should know... i coded most of it... and the initial merge on my PR on searching was over 2 years ago (or something like that). and i have waited for this code to be released to the ZC community. which is now is. and part of it can be seen here:
https://github.com/zencart/zencart/b....php#L160-L210
in fact, i saw that my code was being re-used on the search modal in the bootstrap template.
now, could this be improved? no doubt; i think most code can be improved.
but coming onto the ZC forum and promoting code that modifies the ZC core is not my idea of supporting the community. if you think your code is so great, where is the PR on github? why not use notifiers?
i think anyone who is thinking about changing all of those core files should think long and hard.
and if you really want better searching on the customer side, i would look at this plugin:
https://github.com/marco-pm/zencart_instantsearch
finally, the new search functions that are now merged into the v158 core are used throughout the repository; including on the admin side.
at some point, i hope to write something up in the docs.
second finally: i will look close at the blog post, and perhaps consider adding some of the code to the ZC core. which i think better supports the community. or maybe @jadebox can do it.
best.
I shared something I found useful and gave a warning about why it mignt not be the best way to accomplish the goal. I documented it for my own reference and thought it might be useful to other users of Zen Cart and to the developers.
I didn't intend to disparage you or any others working on Zen Cart since I really appreciate the work that has gone into it. I would have suffered though the effort to convert to another shopping cart if the 1.5.x upgrade had not been such an improvement over the 1.3.x version I was using.
You are quite welcome to use any of the code or ideas from the blog post if you find them useful. I am willing to help but free time is in short supply for me until I finally decide to retire.
Thanks for all the inputs.
Instant search plug-in mentioned by @carlwhat is great. However, it doesn't search the description by the latest published version (v2.1.0). Its author mentioned adding description search could slow down the site which makes senses to me. I don't want to make my site slower again...
https://www.zen-cart.com/downloads.php?do=file&id=1336
The trick mentioned in this thread is not ideal, but it works for description search and it is not difficult to modify the code.