| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Add a true Google search to your X-cart. | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Add a true Google search to your X-cart.
Hello all,
I've just finished adding a site-specific google-search to our advanced search page. For anyone interested, here's how to do it for x-cart 3.3.1...please note that I've already made fix for the price search bug in version 3.3.1: First you need to sign up for a Google API key at: http://www.google.com/apis/ Then, you need to download the excellent google search class and supporting files from the original author (written in French). You can find them here: ftp://ftp2.xhtml.net/xhtml/php/google.zip Then extract the files you downloaded and upload everything except index.php into your /customer/ folder. So you should have copied the following extracted files from the google.zip file to the /customer/ folder: SOAP_Google.php PEAR.php The entire SOAP directory Then you should replace your customer/search.php page with the following code: Code:
Then you should replace your /skindirectory/customer/main/search_result.tpl with the following code: Code:
Oh yeah, and replace the skindirectory/customer/main/advanced_search.tpl with the following code: Code:
Now look at the customer/search.php page and fill in your key where it says: Code:
Replace the parameters with your google key and your url, save and upload the file. You're done. You now have a google search embedded in your site that will search only your site. It will also offer spelling suggestions whenever possible for misspelled queries that don't return any results. If you wish to change the format of the navigation links at the bottom of the results, just modify the search.php page, as I've not bothered to use $smarty logic for the nav link generation. It's just way easier to do it with php and then spit it out into the template once the links are formatted. Feel free to do whatever you want with this code. Someone else did all the hard work here, I just put it together with x-cart.
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#2
|
|||||||||
|
|||||||||
Do you have a working version of this anywhere to take a look at ?
Sounds good
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#3
|
|||||||||
|
|||||||||
Here's a link
Here'a link where you can see it in action, but please don't test our cart as we don't want our stats to be tainted any more than they already are...
http://www.realestate-school.com/online-store/customer/search.php Also, there appears to be a slight problem with the search results navigation links because google estimates the number of results that will be returned and the links are built using this estimate. If the estimate is wrong, then there will be an incorrect number of page links to navigate the results. I think this can be fixed, but haven't tried to fix it yet because I just noticed it.
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#4
|
|||||||
|
|||||||
Google search.
Hi, my name is Arthur, i got x-cart 3.3.4, and i did like you explain, but it's not working at all. Please help.
My page is: http://www.indymart.net/buy/customer/home.php |
|||||||
#5
|
|||||||||
|
|||||||||
This code was written for x-cart 3.3.1 so I can't really help you until I upgrade which will probably not be any time soon. I'd suggest looking at the differences between the code in the original files for versions 3.3.1 and 3.3.4. If there aren't any major differences in the original files, then it should probably work, but that's all I can say for now.
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#6
|
|||||||
|
|||||||
Google search.
Hi, when i click on submit button, it's redirect me to Google site, but on you page results shown on your site, please help fix it. Thank you, Arthur
|
|||||||
#7
|
|||||||||
|
|||||||||
Oh yeah...sorry...
Ooops...my bad. I posted the wrong version of the advanced_search.tpl file. I have edited my post above to reflect the proper version. I had modified the script from home and forgot to download it to my work computer when I posted the code here so I ended up posting old code. Sorry for the trouble. Let me know if the new code works better...you should just need to fix your advanced_search.tpl file.
Good luck, Brett.
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#8
|
|||||||
|
|||||||
Google search.
Hi, still not work in 3.3.4 version.
|
|||||||
#9
|
|||||||||
|
|||||||||
bummer.
Uh...could you maybe tell me what you've done so far? Did you follow all the instructions from the beginning of this post? You do have to download some files from hotscripts.com so let me know what you've tried and I'll see if I can help. Like I said above, this modification was done to x-cart version 3.3.1. I've got a heavily modified version of an early release of the 3.3.x codebase, so I've had to fix many bugs that have already been fixed in newer releases. The newer versions may have crucial parts that now work completely differently (though most likely only minor diffs). So anyway, give me more info and I'll try to help you. Oh yeah...and make sure you have PEAR installed on your server (part of standard PHP install). Though it is unlikely that PEAR would not be installed, it is possible. If it's not installed, then this script will certainly cause errors. Oh wait...that's another project....uhhh....forget about PEAR, it's not used here.
__________________
www.brettbrewer.com Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more. |
|||||||||
#10
|
|||||||
|
|||||||
I haven't tried it, but that's some good code right there.
Good work!
__________________
Joshua Sowin ...taking things one TPL at a time. |
|||||||
|
|||
X-Cart forums © 2001-2020
|