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)
-   -   Any idea how to use "dynamic ajax search" with Smart Search (https://forum.x-cart.com/showthread.php?t=54740)

anandat 07-26-2010 10:21 AM

Any idea how to use "dynamic ajax search" with Smart Search
 
Hi,
Phil has created nice FREE dynamic ajax search module http://www.xcartmods.co.uk/x-cart-ajax-dynamic-product-search.html

But any one knows how it can be configure to work with Smart Search ?

According Phil it easily works with Smart Search so any body has done yet ?

If so then please share the code :)

Thanks

balinor 07-26-2010 10:22 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Moving to Third Party Add-Ons

PhilJ 07-26-2010 10:29 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
As far as I know, install the mod up to part 4, then...

skin1/modules/Smart_Search/smart_search.tpl

Change...
Code:

<input name="q" type="text" value="{$searchstring|escape:'html'}" size="50" />
To...
Code:

<input type="text" name="q" class="text" value="{$lng.lbl_search}" size="50" onblur="if(this.value=='') this.value='{$lng.lbl_search}';" onfocus="if(this.value=='{$lng.lbl_search}') this.value='';" autocomplete="off" onKeyUp="ajax_showOptions(this,'getProduct',event)" onBlur="this.form.submit();" />

anandat 08-03-2010 07:11 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
PhilJ,
You rock man....it's worked like a charm :)

Could you please do one favor...I need separate search box to find out manufacturers also...is it possible ? or it possible to provide option to search manufactures with same search box ?

It will be great help mate :)

PhilJ 08-03-2010 09:03 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
I'd suggest you just include the manufacturer names in your product names.

Or, create a separate manufacturer dropdown, eg.

Code:

<form method="get" action="manufacturers.php">
<select name="mid" onchange="this.form.submit()">
 <option value="0" selected>{$lng.lbl_manufacturers}...</option>
 {section name=mid loop=$manufacturers_menu}
 <option value="{$manufacturers_menu[mid].manufacturerid}"{if $mid eq $manufacturers_menu[mid].manufacturerid} selected{/if}>{$manufacturers_menu[mid].manufacturer}</option>
 {/section}
</select>
</form>


v4.4.x

Code:

<form method="get" action="manufacturers.php">
<select name="manufacturerid" onchange="this.form.submit()">
 <option value="0" selected>{$lng.lbl_manufacturers}...</option>
 {section name=mid loop=$manufacturers_menu}
 <option value="{$manufacturers_menu[mid].manufacturerid}"{if $mid eq  $manufacturers_menu[mid].manufacturerid}  selected{/if}>{$manufacturers_menu[mid].manufacturer}</option>
 {/section}
</select>
</form>


anandat 08-03-2010 10:51 PM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Phil,
Thanks for your reply.
Actually I have set the option in admin "Manufacturers list limit (leave empty if unlimited)" - 10
So it just displaying 10 manufactures only when I insert your above code.
I have around 2500 manufactures & it's not good idea to show all of them in one page. And that's the reason I required to give option to search manufactures also.
Any other possible way to allow customer to search manufacturer quickly ? I am already using http://www.websitecm.com/news/new-x-cart-mods/new-x-cart-module-manufacturers-a-z-for-xcart/ mod to display manufactures more effectively.

Also I am using your very effective nice little cool mod http://www.xcartmods.co.uk/x-cart-filter-by-manufacturer.html

Paulw 03-10-2011 06:54 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Quote:

Originally Posted by PhilJ
As far as I know, install the mod up to part 4, then...

skin1/modules/Smart_Search/smart_search.tpl

Change...
Code:

<input name="q" type="text" value="{$searchstring|escape:'html'}" size="50" />
To...
Code:

<input type="text" name="q" class="text" value="{$lng.lbl_search}" size="50" onblur="if(this.value=='') this.value='{$lng.lbl_search}';" onfocus="if(this.value=='{$lng.lbl_search}') this.value='';" autocomplete="off" onKeyUp="ajax_showOptions(this,'getProduct',event)" onBlur="this.form.submit();" />


Has this changed now as the file is different on the latest version of smart search?

PhilJ 03-10-2011 06:57 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Yes, as you're using v4.4.x it will probably be...

skin/common_files/modules/Smart_Search/smart_search.tpl



Paulw 03-15-2011 07:38 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Quote:

Originally Posted by PhilJ
Yes, as you're using v4.4.x it will probably be...

skin/common_files/modules/Smart_Search/smart_search.tpl




Thanks Phil,

I've uploaded everything to www.waterfeatures2go.co.uk

But it doesn't seem to be working any ideas where I may have gone wrong?

Paul

Paulw 03-23-2011 08:52 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Quote:

Originally Posted by Paulw
Thanks Phil,

I've uploaded everything to www.waterfeatures2go.co.uk

But it doesn't seem to be working any ideas where I may have gone wrong?

Paul


Still haven't got a sulution Phil. Not sure this mod actually works on 4.4.1

PhilJ 03-23-2011 08:55 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
It's included with our v4.4.x template, so it does work fine, in fact all v4.x versions.

Make sure you have uploaded the files to the correct locations, made the relevant updates to your search box code and added your database details to dsearch.php

Update your support ticket with your FTP details and I'll sort it for you.

Paulw 03-24-2011 01:57 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Phil, I've solved the issue now I had to alter the following file:

smart_search_customer_44.tpl

{*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Smart Search :: alteredCart.com
| All code developed by Bill Brewer
| Copyright (c)2007-2010 alteredCart
| Bill Brewer <bill@alteredcart.com>
| All rights reserved.
| This code is licensed for use on a single server.
| This code is licensed for use by the original purchaser only.
| Full license :: www.alteredcart.com/license.php
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*}

<div class="search">
<div class="valign-middle">
<form method="get" action="_search.php" name="_search">
<input type="hidden" name="page" value="1" />

{strip}

<input type="text" name="q" class="text{if not $search_prefilled.substring} default-value{/if}" value="{$search_prefilled.substring|default:$lng.l bl_search|escape}" />
{include file="customer/buttons/button.tpl" type="input" style="image"}

{/strip}

</form>

</div>
</div>


to the following:

{*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Smart Search :: alteredCart.com
| All code developed by Bill Brewer
| Copyright (c)2007-2010 alteredCart
| Bill Brewer <bill@alteredcart.com>
| All rights reserved.
| This code is licensed for use on a single server.
| This code is licensed for use by the original purchaser only.
| Full license :: www.alteredcart.com/license.php
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*}

<div class="search">
<div class="valign-middle">
<form method="get" action="_search.php" name="_search">
<input type="hidden" name="page" value="1" />

{strip}

<input type="text" name="posted_data[substring]" class="text" value="{$lng.lbl_search}" onblur="if(this.value=='') this.value='{$lng.lbl_search}';" onfocus="if(this.value=='{$lng.lbl_search}') this.value='';" autocomplete="off" onKeyUp="ajax_showOptions(this,'getProduct',event) " onBlur="this.form.submit();" />

{include file="customer/buttons/button.tpl" type="input" style="image"}

{/strip}

</form>

</div>
</div>


Thanks for your help with this.

Paulw 03-24-2011 03:09 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Phil,

The functionality is still not correct.

http://www.waterfeatures2go.co.uk

When you type a product name it generates the java drop down correctly. However if for example you enter a general term such as "water features" and click the search button it should produce loads of results but it doesn't produce any. It just shows the smart search box under. If you then type the same phrase into the smart search box i.e. water features it shows many results. Do you have any idea why it's performing this functionality?

thanks
Paul

PhilJ 03-24-2011 03:19 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
The functionality works fine, but you need to add a submit button, so customers can either a) click directly to a product via the dropdown or b) submit their chosen search terms.
Code:

<input name="search" type="button" value="GO" />
Let me add, that the module was never intended to work with smart search. I was under the impression smart search already has its own 'auto complete' addon.

Paulw 03-24-2011 03:27 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Quote:

Originally Posted by PhilJ
The functionality works fine, but you need to add a submit button, so customers can either a) click directly to a product via the dropdown or b) submit their chosen search terms.
Code:

<input name="search" type="button" value="GO" />


Thanks for the advise, but isn't that what the symbol of the magnifying glass is on the site? AS I already have this and by pressing on it produces blank results?

ScrapOrchard 05-19-2011 06:42 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Hey Phil,

I opened a support ticket a while back because I had a couple questions. I installed this awesome mod on my site, but wanted to know if:

a) there is a way to have the drop-down disappear when someone clicks outside the search box?

b) there is a way to make it *not* require you select one of the product titles when I want to submit the search term with pressing the Enter key? For instance if I type in girl and I just want to search all the products with girl in the keywords, description, etc... I don't want to have to select one of the titles that happens to have girl in it. As it is, I can only submit the search for the term girl if I click on the submit/arrow button. If I simply press the Enter key, it populates the search field with one of the product titles..

ScrapOrchard 06-06-2011 01:13 PM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
Hrm.

Pretty disappointed with xcartmods.co.uk's customer service or complete lack of it. I have opened two tickets with them weeks ago and still have not heard back from them.

I guess I will look elsewhere for a better dynamic search mod. It is a shame, because they had several mods on my 'things to get' list... but I seriously have issues with poor customer service and refuse to shop at a store who cannot be bothered to respond to customer inquiries.

Paulw 06-23-2011 04:00 AM

Re: Any idea how to use "dynamic ajax search" with Smart Search
 
I've just had Smart Search Kindly updated by Bill so that on 4.4.1 onwards, it now displays available for sale products which have no stock. This is as I have a pre-order / backorder mod.

However I now could do with the Dynamic Ajax Search to do the same as it currnetly only show products that have more than 1 in stock.

The code Bill added was to "smart_search_query_sql.php" as follows:

if (isset($config['General']['show_outofstock_products']))
$config['General']['disable_outofstock_products'] = $config['General']['show_outofstock_products'] == 'Y' ? 'N' : 'Y';

Can "dsearch.php" be altered so that it brings up available for sale "0" stock products also?


All times are GMT -8. The time now is 12:15 AM.

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