MOD: Thumbnail,Product info & Delete in Cart Sidebox

A simple MOD for adding the following to the Cart side-box:

-Thumbnail

-Productname (shortened to …, but completely visible on tooltip incl. amount)

-Delete-button









Very simple to add: it looks like quite a lot at first glance, but its just 3 simple steps:



[COLOR=“Red”]STEP 1:

---------------------------------------[/COLOR]

Add the following line in this file:

[COLOR=“Blue”]/skins//customer/side_boxes/cart.tpl[/COLOR]

below this existing line (around line 6):

```php {include file=“cart_pages/cart_status.tpl”} ```

you add this line:

```php {include file=“cart_pages/cart_thumbs.tpl”} ```







[COLOR=“Red”]STEP 2:

---------------------------------------[/COLOR]

[COLOR=“Blue”]Create a NEW file[/COLOR], so open notepad or similar and put this code in:

```php

{* $Id: cart_thumbs.tpl 2006-10-31 nwsco $ *}



{if $cart_products}

{literal}

.thumb_cart_divider { border-bottom:1px dotted #808080; } /you can move this line to styles.css if you like/

{/literal}


{foreach from=$cart_products item="product" key="key"}





{/foreach}


{include file="common_templates/image.tpl" image_width=30 obj_id=$key images=$product.main_pair object_type="product"}


{$product.product|truncate:15:".."}

{$lang.remove} {$product.amount}x



{/if}
```
Save it here, under the name [B][COLOR="Blue"]cart_thumbs.tpl[/COLOR][/B], so here:
[COLOR="blue"]/skins//customer/cart_pages/[B]cart_thumbs.tpl[/B][/COLOR]



[COLOR="Red"][B]STEP 3:[/B]
---------------------------------------[/COLOR]
Add the following code at the bottom of the file:
[COLOR="blue"]/include/customer/cart_status.php[/COLOR] (one line before the ?>)
```php
extract(fn_calculate_cart_content($cart, $auth, true, false));
if (!empty($cart_products)) {
foreach($cart_products as $k => $v) {
fn_gather_additional_product_data($cart_products[$k], true);
}
}

$smarty->assign_by_ref('cart_products', $cart_products);
```




Result looks like this:
[ATTACH]205[/ATTACH]



There's still a small [COLOR="blue"]bug[/COLOR] in there, only when using ajax with the cart (this doesnt hinder any functionality though!):
If you add a product, you cannot see the thumbnail&info for this directly (ajax).
Add another one (or add the same again) and then you [U]will[/U] see it,
so there's a delay of 1 product (presuming you dont do a page-refresh
or change to another page, but stay on the same page).

If someone has a nice solution for this, please share: i cant find the
time for this right now, sorry.

Again, all quick & dirty but should work just fine. If not, post here please.

Tested with version 1.3.4
Note that this (of course) does slow down every page a bit by a few ms.

good luck :cool:

articlecart.gif

Very nice, looks good…with that kind of coding you should be able to make your post here work:

[url]http://vb.cs-cart.com/showthread.php?t=1123[/url]

Hi nwsco


[QUOTE] Save it here, under the name [COLOR=Blue]cart_thumbs.tpl[/COLOR], so here:

[COLOR=blue]/skins//customer/side_boxes/cart_thumbs.tpl[/COLOR][/QUOTE]



Nice Mod, but the cart_thumbs.tpl needs to be in the [COLOR=blue]/skins//customer/cart_pages/cart_thumbs.tpl[/COLOR]

nwsco

your mods are great!!. can they be put in to one place so when the final version is complete and others(me LOL) want to impliment them we can find them in one place.



Keep em’ commin

@lisa: thanks lisa, but they’re simple (and quick&dirty) ones, but do make the cart better-looking yes and seem more luxury. it would be nice it some of them would be implemented yes with an option to enable/disable in the admin.



@zardos: the file needs to be where you call it from in the {include}line,

so it can even be in the root lol, but as to my post, you’re right! sorry: ill change it.



@sno:can be done 2 ways: with or without ajax. It’s not a hard mod at all, just a bit time-robbing, but thats ok. If i find a day off here or there ill make it, np. It probably has to be without ajax, since i never dived into that cause i been sick for almost a year and missed the ajax-hype a bit lol, although i did implement it once. without ajax its just as fast i think and more stable.

Note that all 's are hidden when the

comes near them. i hate

that actually, but its inevitable, since any select behaves as a window.



but if someone else get’s a start and need technical help, that is also an option: i’m available.

dont sell yourself short. the mods are great. q&D and all. its great that you took the time to do them ( i mean this for everyone else too) and you are posting them for all of us.

wicked. i will definitely implement this once .4 comes out.



thank you for putting this together.



=)

time considering i think it is fine for the u.i. client experience.



@sno:can be done 2 ways: with or without ajax. It’s not a hard mod at all, just a bit time-robbing, but thats ok.”

[quote name=‘nwsco’]A simple MOD for adding the following to the Cart side-box:

-Thumbnail

-Productname (shortened to …, but completely visible on tooltip incl. amount)

-Delete-button









Very simple to add: it looks like quite a lot at first glance, but its just 3 simple steps:



[COLOR=“Red”]STEP 1:

---------------------------------------[/COLOR]

Add the following line in this file:

[COLOR=“Blue”]/skins//customer/side_boxes/cart.tpl[/COLOR]

below this existing line (around line 6):

```php {include file=“cart_pages/cart_status.tpl”} ```

you add this line:

```php {include file=“cart_pages/cart_thumbs.tpl”} ```







[COLOR=“Red”]STEP 2:

---------------------------------------[/COLOR]

[COLOR=“Blue”]Create a NEW file[/COLOR], so open notepad or similar and put this code in:

```php

{* $Id: cart_thumbs.tpl 2006-10-31 nwsco $ *}



{if $cart_products}

{literal}

.thumb_cart_divider { border-bottom:1px dotted #808080; } /you can move this line to styles.css if you like/

{/literal}


{foreach from=$cart_products item="product" key="key"}





{/foreach}


{include file="common_templates/image.tpl" image_width=30 obj_id=$key images=$product.main_pair object_type="product"}


{$product.product|truncate:15:".."}

{$lang.remove} {$product.amount}x



{/if}
```
Save it here, under the name [B][COLOR="Blue"]cart_thumbs.tpl[/COLOR][/B], so here:
[COLOR="blue"]/skins//customer/cart_pages/[B]cart_thumbs.tpl[/B][/COLOR]



[COLOR="Red"][B]STEP 3:[/B]
---------------------------------------[/COLOR]
Add the following code at the bottom of the file:
[COLOR="blue"]/include/customer/cart_status.php[/COLOR] (one line before the ?>)
```php
extract(fn_calculate_cart_content($cart, $auth, true, false));
if (!empty($cart_products)) {
foreach($cart_products as $k => $v) {
fn_gather_additional_product_data($cart_products[$k], true);
}
}

$smarty->assign_by_ref('cart_products', $cart_products);
```




Result looks like this:
[ATTACH]205[/ATTACH]



There's still a small [COLOR="blue"]bug[/COLOR] in there, only when using ajax with the cart (this doesnt hinder any functionality though!):
If you add a product, you cannot see the thumbnail&info for this directly (ajax).
Add another one (or add the same again) and then you [U]will[/U] see it,
so there's a delay of 1 product (presuming you dont do a page-refresh
or change to another page, but stay on the same page).

If someone has a nice solution for this, please share: i cant find the
time for this right now, sorry.

Again, all quick & dirty but should work just fine. If not, post here please.

Tested with version 1.3.4
Note that this (of course) does slow down every page a bit by a few ms.

good luck :cool:[/QUOTE]

I was wondering if there is any reason this would not function with 1.3.3? I followed the directions above but my screens all go blank...not sure if it is a 1.3.3 issue or if I did something incorrect...I would love to get this working and thanks!!!

Cheers,
Travis

was the bug fixed?

i dont think there is a bug. 1.3.3 just works different and this is,as i said,

a q&d one for 1.3.4.

i saw another article explaining (today/yesterday?) some differences between 3 & 4

that might clear things up.

[quote name=‘nwsco’]

i saw another article explaining (today/yesterday?) some differences between 3 & 4 that might clear things up.[/QUOTE]



Yes, there are different files that control the presentation of images between the 1.3.3 and 1.3.4 versions. Basically, the code that displays images in 1.3.4 mods will not work in on older versions without several changes.

thats right m8.

maybe you can place the link here were you explain this a little bit better,

so they can have a look at it? i couldnt find it anymore (1-2-3)!



thx eric! you’re a real contribution to this forum, i know that!

i am going to try to lay this in.



thanks =)

works like a charm

the only thing that would make this even better would be to have the thumb show up immediately without have to refresh the page.



other than that wicked mod.

GREAT MOD



When you add items the cart goes on and on and on. Is there anyway we can make the thumbnails the last 5 items added to cart.



ALSO can we fix the bug? ill help out as much as i can :slight_smile:

Great MOD… I wrote one myself before, but this one uses delete button. I LIKE…



-MAK

[quote name=‘akmarket’]GREAT MOD



When you add items the cart goes on and on and on. Is there anyway we can make the thumbnails the last 5 items added to cart.



ALSO can we fix the bug? ill help out as much as i can :)[/QUOTE]



sure, quick and dirty:



[COLOR=“Blue”]All in the NEW file (cart_thumbs.tpl):



STEP 1:

--------------------------------------------------------------[/COLOR]

put this line ABOVE the line [COLOR=“Red”]{foreach from=$cart_products item=“product” key=“key”}[/COLOR]:

[COLOR=“seagreen”]{assign var=“fe_count” value=1}[/COLOR]





[COLOR=“blue”]STEP 2:

--------------------------------------------------------------[/COLOR]

directly UNDER the [COLOR=“red”]{foreach from=$cart_products item=“product” key=“key”}[/COLOR]

[COLOR=“seagreen”]{if $fe_count lt 5}[/COLOR]





[COLOR=“blue”]STEP 3:

--------------------------------------------------------------[/COLOR]

and directly ABOVE the [COLOR=“red”]{/foreach}[/COLOR]

[COLOR=“SeaGreen”]{/if}[/COLOR]







note: not tested myself, so please correct if wrong…

there’s other ways of doing this; this is just one of them…

it didint work?! its the same issue