Keep track of keywords searched!
Hello everyone,
I am new to x-cart (migrated from oscommerce) and wanted to be able to see what my customers were searching for when visiting my shop. I had this feature in my oscommerce shop (from a contribution) so I decided to try and make it happen with xcart. I Must warn you, this is my first attempt at doing anything like this and I am no programer... SO USE IT AT YOUR OWN RISK!!!!!! and BACKUP!!!BACKUP!!!BACKUP!!! Oh, and it also looks ugly. Maybe one of the pros can make it a little prettier? Here we go.... First ad 2 new tables to the DB... Code:
# Now open /xcart/customer/search.php and add the following (in between the comments)... Code:
# Now create a new file /xcart/customer/stats_keywords.php with the code below... Code:
<?php This should be it. Now everytime someone searches for anything in your store, it will be saved to the DB for your viewing. This is very useful so you know what people are most looking for. ----------------------------------- One thing: 1. When you go to http://www.domain.com/xcart/customer/stats_keywords.php , you'll not see the keywords yet. You'll need to click on "Update DB" then click on either "Sort by name" or "Sort by count" buttons to view the collected data. I think that is it. Hope this helps and I look forward to any suggstions for improvement ;) |
ROCK ON - can't wait to try it! :)
did you implement this on 3.5.5?? Thank you for a useful mod!! :!: :!: :!: |
Hi Jaime,
I used this on a 3.5.6 Pro but I am pretty sure it will work with 3.5.5 as all it does is collect the keyword from the url and save it to the DB tables you create ;) |
Thanks lot Emerson :) this was much wanted mod.
It's working with 3.5.5 too :!: Thanks once again for it mate. |
YW :)
I'm glad I could help ;) |
While trying to figure out how to fix the count problem, I came across this.
I changed... Code:
$sql_q = mysql_query("select search_text, search_count from search_queries_sorted order by " . to Code:
$sql_q = mysql_query("select search_text, search_count+1 from search_queries_sorted order by " . ...which should have fixed the problem. However, the results are blank. I tried running the query manually via phpMyAdmin and it works fine. Anyone have any ideas what could be causing the problem? |
Found a solution...
It now displays the correct count for the keywords searched... The code has been updated in the original post to reflect this change. |
Return to home.php
Hi !!
I have followed the instructions indicated, but when I send "stats_keywords.php" it gives back me home main :( I running v3.4.14 Anyone have any ideas? greetings!! |
AWESOME! VERY AWESOME! It works perfectly on 3.5.7
I'm gonna' see what I can do to incorporate it into admin. Thank You, Great Mod! :D |
Ok, I made a few small changes that allow you to call this from the Admin area and cleaned up the GUI a little (room for improvement)
First of all stats_keywords.php goes in XCART/admin not XCART/customer, here it is with the changes: UPDATED 05/27/04 TO FUNKY PURPLE (you get the idea) Code:
<?php OOoops! I forgot this... Add this line to skin1/admin/menu_admin.tpl Done! |
All times are GMT -8. The time now is 04:28 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.