Cart Contents In Side Bar

ryu85

Joined: 2007-09-18
Posts: 22
Posted: Fri, 2007-11-02 12:40

Hi,

Have had a look around and can't see anything like this so here goes.

Basically I dont have much in my sidebar aside from a menu and add to cart. It would be nice if you could display the titles (or maybe even thumbs) of the contents of your cart in the side bar, or maybe just the top 5 mos recent items, instead of just having a 'view cart' link.

Anyone have any ideas how to impliment this or if it is indeed possible.

I'll keep looking.

Cheers
Ryan

 
ryu85

Joined: 2007-09-18
Posts: 22
Posted: Fri, 2007-11-02 13:18

sorry to just make an addition. I'm sure the logic isn't too hard, to edit the

# cart.ShowCart

template, its already making calls to find out the total number of items in the cart, is there no way to alter it to grab titles also?

Way beyond my ability i'm afraid but i'm open to guidence :)

the cartContents.tpl uses this call to get item titles:

{foreach from=$ViewCart.items item=item}
{$item.title|markup}<br/>
{/foreach}

Any way to get the showCart.tpl template to be able to do that, and limit the loop to 5.

 
Slayergirl
Slayergirl's picture

Joined: 2007-09-12
Posts: 180
Posted: Fri, 2007-11-02 14:18

Blocks don't have all the functions that are available in the normal template.
Blocks get their information from Callbacks.inc so you need the function there (maybe you can copy/paste a large part from viewcart.inc, not sure)

Some info on creating Blocks with a link to Callbacks info: http://codex.gallery2.org/Gallery2:How_To_Create_Blocks

But if you have no programming skills it might be hard. I am kind of a noobie myself and I am really struggling around to get something working. Even thought I will get it done in the end I am too stubborn to give up completely ;)