Hi there, just came across the same problem with apostrophes. A common oversight in php coding. Just wrap the "$keyword" in step 4 in the instructions in the php function mysql_real_escape_string like so
$searchsql = "insert into " .DB_PREFIX. "search_log (searchterm, date) values ('". mysql_real_escape_string($keyword )."','$mydate')";
And all should be good - worked fine for me
Christoph
Having spent a bit more time on this now, I have got a few suggestions for the author
- instead of putting the code amendments into one of the core files, put it in this file
/includes/templates/YOURTEMPLATE/templates/tpl_modules_product_listing.php
This has the added advantage of doing something I wanted to do: record the numbers of returned results of any search (see next point)
- record the number of returned results. With an increasing number of products in my shop (3500 at the moment) and meta tags and descriptions, it is sometimes hard to know if a search is actually successful. Do this by adding another column to the table, add it to the sql query and use $listing_split->number_of_rows to record it. In the query to return the results, then also group by the results column
- add a link to run the search on the site in the admin/report too. This way you can see what the users see when they search for a keyword, order of results, etc.
Hope you find these good ideas
Christoph
Christoph,
Have a look at the new Search Log contrib I wrote. It is in the downloads section here...
http://www.zen-cart.com/index.php?ma...roducts_id=702
It records the number of search results and has been written so that no files have to be modified.
Regards,
Christian.
This was a great mod, but since I installed 1.3.8a it no longer logs all the searches, only the searches that have results. Therefore it's basically useless.
I have the same problem. The searches with 0 results aren't recorded.
I hadn't actually noticed that someone had uploaded a version 1.1.1 (which is my v1.0 plus a few changes). They probably should have posted something about it. Maybe I missed it. Despite what it says on the download page, the version they have uploaded will not work properly with ZC v1.3.8.
I will release a proper ZC 1.3.8 compatible version next week.
Regards,
Christian.
There was a feature change to 1.3.8 whereby if there are 0 results to a search, the customer is redirected to the search input page to enter new selections, rather than a blank page.
This means that instead of monitoring the NOTIFY_HEADER_END_ADVANCED_SEARCH_RESULTS notifier point, you have to monitor an earlier notifier point instead: NOTIFY_SEARCH_ORDERBY_STRING
Making that change to the class.search_log.php file should suffice, and should work fine with earlier Zen Cart versions as well.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.