I made a hack for version 1.3.4 (maybe also work in v.1.3.3)
so that the bestseller-side-box can be set to 3 different modes:
1: default (standard CS-cart)
2: vertical scrolling with productimages and pause on onmouseover
3: product after product in a box with productimages (time-interval)
They all have some easy-2-set variables in the top of the file for
the display_type, height, image-width and divider color.
Its an easy hack: 2 actions:
[COLOR=“Red”]STEP 1[/COLOR]
----------------------------------------------------
[COLOR=“red”]A NEW FILE, SO NO WORRIES AT ALL
Copy all the text below and save in a NEW file in the directory:
//classes/templater/plugins/function.getimageid.php[/COLOR]
```php
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {getimageid} function plugin
*
* Type: function
* Name: getimageid
* Purpose: returns image_id from given product_id
* @author nwsco
* @param array
* @param Smarty
*/
function smarty_function_getimageid($params, &$smarty)
{
global $db_tables;
if (!isset($params['var'])) {
$smarty->trigger_error("getimageid: missing 'product_id' parameter");
return;
}
if($params['var'] == '') {
return;
}
//get imageid from product_id, store in var:
$tmp_id = db_get_row("SELECT * FROM $db_tables[product_images_links] WHERE product_id = " . $params['var']);
$_result = $tmp_id;
if (!empty($params['assign'])) {
$smarty->assign($params['assign'], $_result);
} else {
return $_result;
}
}
?>
```
[COLOR="Red"][B]STEP 2[/B][/COLOR]
----------------------------------------------------
[COLOR="red"]Replace ALL the code in the file
/skins//customer/addons/bestsellers/sidebox.tpl
with the code below, or change if newer/older version then 1.3.4:[/COLOR]```php
{* $Id: sidebox.tpl 2126 2006-09-19 13:57:58Z zeke $ *}
{if $bestsellers}
{* EDIT BELOW TO YOUR NEEDS *}
{assign var="display_type" value=3} {*1,=standard cs-cart, 2=browsercompatible scroll with pause on onmouseover, 3=changing blocks*}
{assign var="sidebox_height" value="100"} {*height in pixels*}
{assign var="thumb_width" value=40} {*width of thumbnail*}
{assign var="divider_color" value="#cccccc"} {*color of the divider (only display_type 1)*}
{* END EDIT *}
{literal}{/literal}
{if $settings.General.images_location == "database"}
{assign var="tmp_object_type" value="product"}
{else} {* image is stored in file system *}
{assign var="tmp_object_type" value="common"}
{/if}
{capture name="sidebox"}
{if $display_type eq 1}
{foreach from=$bestsellers item=bestseller}
{/foreach}
|
{$bestseller.product} |
{elseif $display_type eq 2}
{literal}
#marqueecontainer{
position: relative;
width: 100%;
height: {/literal}{$sidebox_height}{literal}px;
overflow: hidden;
}
{/literal}
{foreach from=$bestsellers item=product}
{/foreach}
{getimageid var=$product.product_id assign="tmp_images"} {include file="common_templates/image.tpl" image_width=$thumb_width obj_id=$product.product_id images=$tmp_images object_type="$tmp_object_type"} |
{$product.product} |
{else}
{assign var="cnt_b" value=1}
{foreach from=$bestsellers item=product}
{assign var="cnt_b" value=$cnt_b+1}
{/foreach}
{getimageid var=$product.product_id assign="tmp_images"} {include file="common_templates/image.tpl" image_width=$thumb_width obj_id=$product.product_id images=$tmp_images object_type="$tmp_object_type"} {$product.product} |
{literal}
{/literal}
{/if}
{/capture}
{include file="common_templates/sidebox.tpl" title=$lang.bestsellers content=$smarty.capture.sidebox icon="sidebox_icon_bestsellers.gif"}
{/if}
```
---------------
An example of display_type 2 and 3 (1=cs-cart default: paste the default
code in there if your version is newer)
[ATTACH]194[/ATTACH]
This is just a q&d hack, adjust to your needs when a little goes wrong or so.
it shouldnt tho, since one file is new, and the other is easily replaced!
(or set display_type to 1, which is cs-cart default v.1.3.4)
Or download as easy zip, read the readme.txt, which is included.....
[ATTACH]202[/ATTACH]
Tested in ie6,ie7 & FF1.07