| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
#11
|
|||||||
|
|||||||
Re: Dynamic Product Search (ajax) - FIX
This mod will work with XC 4.1.8 with the Fashion Mosaic skin.
Follow in the mod installation file, with the following changes: STEP 1) SKIP THIS STEP STEP 2) EDIT /dsearch.php. REMOVE LINES 2 - 5 // SET MYSQL INFORMATION $conn = mysql_connect("LOCALHOST","USERNAME","PASSWORD"); // CONNECT TO MYSQL DATABASE mysql_select_db("DATABASE",$conn); ADD: require "./auth.php"; FIND THIS FOLLOWING LINE. (The search list will not display products with 0 available. If you are not using inventory tracking or want to display products no in stock in the search list make this change. Otherwise, skip this step.) $res = mysql_query("select productid,product from xcart_products where forsale='Y' AND avail>0 AND product like '".$letters."%'") or die(mysql_error()); REPLACE WITH THIS UPDATED LINE $res = mysql_query("select productid,product from xcart_products where forsale='Y' AND avail>=0 AND product like '".$letters."%'") or die(mysql_error()); STEP 3) Upload all files, then rename dsearch[v4.0.x].tpl or dsearch[v4.1.x].tpl to dsearch.tpl, according to your version. STEP 4) Add this code to /skin1/customer/home.tpl before </head> <link rel="stylesheet" href="{$SkinDir}/dsearch/dsearch.css"> <script type="text/javascript" src="{$SkinDir}/dsearch/ajax.js"></script> <script type="text/javascript" src="{$SkinDir}/dsearch/dsearch.js"></script> STEP 5) SKIP THIS STEP STEP 6) Modify 'skin1/dsearch/dsearch.js" file: CHANGE ajax_list_MSIE from true to false: ORIGINAL LINE: if(navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('Opera')<0)ajax_list_M SIE=true; CHANGED LINE: if(navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('Opera')<0)ajax_list_M SIE=false; STEP 7) Copy dsearch.tpl to "skin1/customer" directory Back-up skin1/customer/search.tpl (cp search.tpl search.tpl.old) Copy dsearch.tpl to search.tpl (cp dsearch.tpl search.tpl) NOTE ==== To reduce the load on your server, in "skin1/dsearch/dsearch.js", modify... var minimumLettersBeforeLookup = 2; // Number of letters entered before a lookup is performed. YOU'RE DONE.
__________________
:::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::: X-Cart Pro 4.1.8 (Linux) (4.1.10 upgrade pending) |
|||||||
|
#12
|
|||||||||
|
|||||||||
Re: Dynamic Product Search (ajax) - FIX
Quote:
Hi, when I installed this Dynamic Product Search (ajax) mod as it was instructed originally, everything worked fine but I wanted to illuminate $conn from dsearch.php code. I did it like you suggested by replacing it with require "./auth.php";. Also I changed "=true" to "=false". My x-cart is 4.0.11. Do you know what it might be wrong or missing? Thank you in advance, clik
__________________
__________________ XC5: 5.3.4.4 PHP: 7.0.26 MySQL server: 5.5.56-MariaDB |
|||||||||
#13
|
|||||||
|
|||||||
Re: Dynamic Product Search (ajax)
Mod updated and tested working fine with v4.3.x
Info - http://www.xcartmods.co.uk/x-cart-ajax-dynamic-product-search.html Demo - http://www.xcartmods.co.uk/demos/43x/home.php
__________________
xcartmods.co.uk |
|||||||
#14
|
|||||||
|
|||||||
Re: Dynamic Product Search (ajax)
Quote:
This will work with Smart Search or only works with default x-cart search ?
__________________
X-Cart: 4.7.7 LIVE Skin:Ultra by xcartmods.co.uk X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9) --------------- Server: Linux php: 5.3 mysql: 5.0.89 ---------------- |
|||||||
#15
|
|||||||
|
|||||||
Re: Dynamic Product Search (ajax)
Quote:
__________________
xcartmods.co.uk |
|||||||
#16
|
|||||||||
|
|||||||||
Re: Dynamic Product Search (ajax)
Question - This instructions are written the following way:
Code:
However; there does not appear to be instructions for all other versions? I could probably figure it out, but rather play it safe.
__________________
Carl Tice X-Cart 4.6.6 X-Payments 3.0 ReBOOT 3.4.1 PHP 5.6.30 MySQL 5.6.35 Linux 2.6.32-042stab120.18 ionCube PHP Loader v4.7.3 Perl 5.10.1 |
|||||||||
#17
|
|||||||
|
|||||||
Re: Dynamic Product Search (ajax)
Skip that part, as you're using v4.3.2.
I'm taking that part out of the install.txt
__________________
xcartmods.co.uk |
|||||||
#18
|
|||||||||
|
|||||||||
Re: Dynamic Product Search (ajax)
Show just move on to step 2 then... Cool. Checking out some of your other freebee stuff on your site. Very nice! Have downloaded a few of them and can't wait to check them out.
__________________
Carl Tice X-Cart 4.6.6 X-Payments 3.0 ReBOOT 3.4.1 PHP 5.6.30 MySQL 5.6.35 Linux 2.6.32-042stab120.18 ionCube PHP Loader v4.7.3 Perl 5.10.1 |
|||||||||
#19
|
|||||||
|
|||||||
Re: Dynamic Product Search (ajax)
Quote:
Thanks for the answer. Very glad to know that it will work with Smart Search also. But can you please tell me how to configure this mod for Smart Search since the installation guide you provided is only for default x-cart search only. Thanks in advance for any help
__________________
X-Cart: 4.7.7 LIVE Skin:Ultra by xcartmods.co.uk X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9) --------------- Server: Linux php: 5.3 mysql: 5.0.89 ---------------- |
|||||||
#20
|
|||||||
|
|||||||
Re: Dynamic Product Search (ajax)
Dear PhilJ,
I installed this free mod on our website (4.2.0) and it's working perfect, thanks. One question though, when you enter a search term with a hyphen in it, followed by a character, the search doesn't seem to work anymore (read: doesn't display any results). For example, when I enter (I set the search trigger to only 2 characters): SP it gives me results like SP-LAMP-007 (a product name) SP- gives the same result SP-L no results anymore, while it should still display SP-LAMP-007 LAMP (no hypen) gives the SP-LAMP-007 result again, as it should. Any idea how to change this behavior? I suspect it has something to do with the preg_replace function ($letters = preg_replace("/[^a-z0-9 ]/si","",$letters); but no idea how to edit it)? Thanks a lot, Dennis
__________________
www.qualitylamps.eu X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9 www.vervangjelamp.nl X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2 Sorry for the weird user name, I registered it by mistake |
|||||||
|
|||
X-Cart forums © 2001-2020
|