Auto Suggest Modded With Pictures Preview

Hi just my two pence worth…



Once you have installed the Auto Suggest Mod by ShippingKit.com, You will find inside your folder as follows the file called: list.tpl



Iside your skins folder…

\customer\addons\autosuggest\views\products\components\list.tpl



it contains the code:


{foreach from=$products item="product" name="autosuggest"}<br />
<li{if $smarty.foreach.autosuggest.last} class="last"{/if}><a href="{$index_script}?dispatch=products.view&product_id={$product.product_id}">{$product.product}</a></li><br />
{/foreach}<br />

```<br />
<br />
Well all I did was made my own addition and replaced the code with the following<br />
<br />
```php
{* $Id: list.tpl 2010-03-31 03:34am zee $ *}<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br />
  <tr><br />
    <td width="84%">{foreach from=$products item="product" name="autosuggest"}<br />
<li{if $smarty.foreach.autosuggest.last} class="last"{/if}><a href="{$index_script}?dispatch=products.view&product_id={$product.product_id}">{$product.product}</a></li><br />
</td><br />
    <td width="17%">{assign var="prod_id" value=$product.product_id}<br />
    {php}<br />
    $product_id = $this->get_template_vars('prod_id');<br />
    $image_id = db_get_row("SELECT image_id FROM cscart_images_links WHERE object_type='product' AND type='M'  AND object_id=$product_id");<br />
    $image_id = $image_id['image_id'];<br />
    if($image_id == null) {<br />
        $image_path = "no_image.gif";<br />
    } else {<br />
        $image_path = db_get_row("SELECT image_path FROM cscart_images WHERE image_id=$image_id");<br />
        $image_path = $image_path['image_path'];<br />
        if($image_path == null) {<br />
            $image_path = "no_image.gif";<br />
        }<br />
    }<br />
    echo "<img src=\"images/product/".$image_path."\" style=\"height: 50px;\" hspace=\"8\" vspace=\"8\" border=\"0\" alt=\"\" />";<br />
    {/php}<br />
	</td><br />
  </tr><br />
  <tr><br />
    <td width="84%">{/foreach}<br />
    </td><br />
    <td width="17%"> </td><br />
  </tr><br />
</table><br />
<p><font color="#FF0000">LIMITED TO 10 RESULTS - FOR MORE PRODUCTS - </font><b><br />
<a href="index.php?dispatch=products.search">CLICK HERE</a></b></p>
```<br />
<br />
The result is quite nice really as you can see from the screenshot below<br />
<br />
Obviously you can change the text that says "limited to 10 results", to reflect what your settings are setup under the mod to show.<br />
<br />
Hope this helps someone.  I love mine.  :rolleyes:<p><a href="127.0.0.1/uploads/monthly_06_2011/post-1551-13081579312135.jpg">screenshot.jpg</a></p>

Nice work! I would move the drop down under the search box though.

How does this affect speed. Are these thumbnails created on the fly or are they held somewhere?

Will give a try later when i get back in.

Simple code that works well. Thanks for sharing.

This is a nice change to this addon. I did notice that the click here for more results part doesn’t seem to work for me. Anyone else have this issue?

I’ve got it working on my site and very easy to do. possibly auto suggest could make it part of their addon.

I also have the problem where click here for more results only brings up the search page rather than more results. Still a worker though. this either needs to be fixed so it shows results, or so it’s not shown at all.



Thanks for the mod to the mod.



You can see it working on my site below.

[quote name=‘mrfoameruk’]I’ve got it working on my site and very easy to do. possibly auto suggest could make it part of their addon.

[COLOR=“Red”]I also have the problem where click here for more results only brings up the search page rather than more results. [/COLOR]Still a worker though. this either needs to be fixed so it shows results, or so it’s not shown at all.



Thanks for the mod to the mod.



You can see it working on my site below.[/QUOTE]



Hi mrfoameruk…



Sorry about that - fixed the link… should work now. see below:





at the bottom of the page the last two lines show the following:



```php

LIMITED TO 10 RESULTS - FOR MORE PRODUCTS -

CLICK HERE

```





Replace these lines with the following:



```php

LIMITED TO 10 RESULTS - FOR MORE PRODUCTS -

CLICK HERE





```





Let me know how you get on. Cheers.

[quote name=‘Tool Outfitters’]Nice work! I would move the drop down under the search box though.[/QUOTE]



Thanks… didnt realise… yep thats easy to fix, there is a styles.css in the Autosuggest folder.



I will change the position there. Cheers.

works fine now.

A1 Mod.

Thanks

I seem to be making more progress each time…:smiley:



I have changed the code and now it will allow you to display the “FOR MORE PRODUCTS” link only when there are more than 10 items suggested. If there are less than 10, then the link will not show up for more results.



Hope that helps anyone.:wink: I will try to promise no more changes…!!



same last two lines shown below :



```php

LIMITED TO 10 RESULTS - FOR MORE PRODUCTS -

CLICK HERE

```



Replace them with :



```php {if $product_count >= “10”}


MAX 10 RESULTS SHOWING - FOR MORE PRODUCTS -
CLICK HERE




{/if} ```

[quote name=‘umera’]I seem to be making more progress each time…:smiley:



I have changed the code and now it will allow you to display the “FOR MORE PRODUCTS” link only when there are more than 10 items suggested. If there are less than 10, then the link will not show up for more results.



Hope that helps anyone.:wink: I will try to promise no more changes…!!



same last two lines shown below :



```php

LIMITED TO 10 RESULTS - FOR MORE PRODUCTS -

CLICK HERE

```



Replace them with :



```php {if $product_count >= “10”}


MAX 10 RESULTS SHOWING - FOR MORE PRODUCTS -
CLICK HERE




{/if} ```[/QUOTE]

Thank You All for this mod, this is what I've been looking for a long time ;) work perfect and looks cool :-P

Only problem I have with this mod is that if a customer types something into the search quickly and then clicks on ‘go or search’, the delay in displaying the box might be missed by a customer. It would be better if the results box appeared instantly either with the results or a note saying ‘performing auto search’ underneath the search box. Does anyone agree? If so can you please add this feature if it’s not too difficult.

[quote name=‘San’]Only problem I have with this mod is that if a customer types something into the search quickly and then clicks on ‘go or search’, the delay in displaying the box might be missed by a customer. It would be better if the results box appeared instantly either with the results or a note saying ‘performing auto search’ underneath the search box. Does anyone agree? If so can you please add this feature if it’s not too difficult.[/QUOTE]



Thats right, is it possible to make it little bit faster, to get results instantly like i google.com?

Try Quick Search. It is much faster than this search and offers more options.

umera, Great Thanks!

Addon work fine! :slight_smile:

When you do a search that pulls more than 10 results, it brings up a message in red saying “Limited to 10 products, etc…”, where can I edit this message? I can’t seem to find it in any of the autosuggest files…

Is it a language variable?



Bob

it’s not, I checked in the Language variables in the admin, it’s not there…

[quote name=‘gugga7’]it’s not, I checked in the Language variables in the admin, it’s not there…[/quote]



Most likely in the JS file that comes with the addon?

[QUOTE]Most likely in the JS file that comes with the addon?[/QUOTE]



It’s not there either, I checked all the files.