X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   Dynamic Product Search (ajax) (https://forum.x-cart.com/showthread.php?t=38144)

l0st 03-08-2008 02:15 PM

Dynamic Product Search (ajax)
 
Hello,

I've just installed this mod and it's not working at all. :oops: Im installing this on v4.1.9

balinor 03-08-2008 05:02 PM

Re: Dynamic Product Search (ajax)
 
Well first we need to know what mod you are talking about...where you got it, what it is called. Next, you should be contacting the vendor where you purchased it for assistance.

l0st 03-08-2008 05:47 PM

Re: Dynamic Product Search (ajax)
 
Sorry I thought that I posted a link.
http://www.xcartmods.co.uk/x-cart-ajax-dynamic-product-search/

Its a free mod and I wouldnt think they offer support for free products. I installed it and it as it said and it didn't work.

kube 03-08-2008 06:24 PM

Re: Dynamic Product Search (ajax)
 
did you make sure that you renamed...
dsearch[v4.1.x].tpl to dsearch.tpl

and have not used dsearch[v4.0.x].tpl by accident?

Do you get any JS errors?

l0st 03-08-2008 06:53 PM

Re: Dynamic Product Search (ajax)
 
Hello,
No it's not providing me with any errors. I still have the dsearch[v4.0.x].tpl file. I have it inside: skin1/dsearch
4 files are there.
dsearch[v4.0.x].tpl
dsearch.tpl
ajax.js
dsearch.css
dsearch.js

I have dsearch.php inside skin1 as well as root dir. I also ran: cleanup.php

l0st 03-09-2008 08:57 AM

Re: Dynamic Product Search (ajax)
 
My head.tpl:
Quote:

{if $usertype eq "C"}
{include file="dsearch/dsearch.tpl"}
{/if}

home.tpl

Quote:


<link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}" />
<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>
{literal}
<script type="text/javascript">
function setCookie(name, value) {
var today = new Date()
var expires = new Date()
expires.setTime(today.getTime() + 1000*60*60*24*30)
document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString() +";path=/"
}
function getCookie(Name) {
var search = Name + "="
if(document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if(offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if(end == -1) end = document.cookie.length
return unescape(document.cookie.substring(offset, end))}
else return ""
}
}
</script>
{/literal}
</head>


I added 'a little before' to show you whats in the code. Everything is in place where it needs to go but it just don't want to work.. any advice/help?

PhilJ 03-09-2008 08:58 AM

Re: Dynamic Product Search (ajax)
 
You're using the fashion mosaic template, so the template layout will be slightly different.

l0st 03-11-2008 08:53 AM

Re: Dynamic Product Search (ajax)
 
So because I use it means I cannot use this mod? Does anyone have a solution?

Monarch1 03-26-2008 06:40 PM

Re: Dynamic Product Search (ajax)
 
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";

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) SORRY HERE"S THE HACK

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.

DONE..

ALERT: AN MS IE Security message will pop-up. Answer yes or no, it doesn't matter.
The search will work. Once I find the cause of the pop-up, I'll post the fix.

Monarch1 03-26-2008 07:17 PM

Re: Dynamic Product Search (ajax)
 
*** UPDATED STEP 2 ***
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) SORRY HERE"S THE HACK

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.

DONE..

ALERT: AN MS IE Security message will pop-up. Answer yes or no, it doesn't matter.
The search will work. Once I find the cause of the pop-up, I'll post the fix.

Monarch1 03-27-2008 10:13 AM

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.

clik 04-07-2009 09:06 PM

Re: Dynamic Product Search (ajax) - FIX
 
Quote:

Originally Posted by Monarch1

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";



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. :roll: Do you know what it might be wrong or missing?

Thank you in advance,
clik

PhilJ 07-23-2010 08:16 AM

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

anandat 07-23-2010 11:39 PM

Re: Dynamic Product Search (ajax)
 
Quote:

Originally Posted by PhilJ

Hi Phil,
This will work with Smart Search or only works with default x-cart search ?

PhilJ 07-24-2010 05:44 AM

Re: Dynamic Product Search (ajax)
 
Quote:

This will work with Smart Search
Yes, I don't see why not.

Vacman 07-24-2010 07:47 AM

Re: Dynamic Product Search (ajax)
 
Question - This instructions are written the following way:
Code:

1) If you are running v4.0.x, in search.php,
below...


However; there does not appear to be instructions for all other versions? I could probably figure it out, but rather play it safe.

PhilJ 07-24-2010 07:52 AM

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

Vacman 07-24-2010 07:54 AM

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.

anandat 07-24-2010 09:17 PM

Re: Dynamic Product Search (ajax)
 
Quote:

Originally Posted by PhilJ
Yes, I don't see why not.

Phil,
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 :)

retrtrtrytrutru 08-24-2010 04:43 AM

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

PhilJ 08-25-2010 05:57 AM

Re: Dynamic Product Search (ajax)
 
Simply replace...
Code:

a-z0-9
With...
Code:

a-z-0-9-

retrtrtrytrutru 08-25-2010 10:50 PM

Re: Dynamic Product Search (ajax)
 
8O that simple.. wow, it's terrible I can't figure this out myself. Thanks Phil.

Regards,
Dennis

PhilJ 08-25-2010 11:41 PM

Re: Dynamic Product Search (ajax)
 
no worries :) I've updated the mod since, so thanks :)

Needlejig 10-10-2010 02:41 PM

Re: Dynamic Product Search (ajax)
 
Thanks for the great free mod!

I have tried adding this to 4.4.1 and can not get it working. I know that it has only been upgraded to 4.3 but I figured that I would have a try with it anyways. Has anyone got it working with 4.4 yet?

Thanks again,
Marc

PhilJ 10-18-2010 04:33 PM

Re: Dynamic Product Search (ajax)
 
It works fine with v4.4.1

Needlejig 10-18-2010 05:41 PM

Re: Dynamic Product Search (ajax)
 
Thanks for getting back to me. I must have monkeyed it up then. I will start over with the backup files.

Needlejig 10-18-2010 05:57 PM

Re: Dynamic Product Search (ajax)
 
I am pretty sure that I copied and pasted the code correctly but I think that I may have put the dsearch directory and dsearch.php file in the wrong locations seeing how there is no skin1 directory in 4.4.1 Where should these go and should I be modifying the files in skin/common_files/customer directory or the skin/MY_TEMPLATE/customer directory?

Needlejig 10-18-2010 06:41 PM

Re: Dynamic Product Search (ajax)
 
If I try it in IE I get this error:

Quote:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C)
Timestamp: Tue, 19 Oct 2010 02:40:49 UTC


Message: Object expected
Line: 439
Char: 1
Code: 0
URI: http://69.167.156.197/


Message: Object expected
Line: 439
Char: 1
Code: 0
URI: http://69.167.156.197/



Can you tell me what I am missing?


All times are GMT -8. The time now is 06:42 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.