Jump to content

List contents of Cart


Criterion
 Share

Recommended Posts

Hi,

I'd like to be able to list the contents of the basket. I know I can query the DB with PHP, but would prefer a simple bit of code in one of the .tpl files. Something like...

{foreach products}

$qty

$product

$variant

$price

{/foreach}

Just outputting plain text, no animation/jquery/etc. Any help appreciated.

Cheers.

Share this post


Link to post
Share on other sites

Hmm. Still struggling.

Does anyone know how to use the {$cart} variable? I've managed to get the total value, but just can't figure out how to list the contents of $cart. It's going to be a {foreach} but I can't see it.

This line... {foreach from=$products item=product name=productLoop} ... in shopping-cart.tpl looks like the one, but when I use it in my module .tpl, is crashes.

I'm supposed to have this module finished by tomorrow, so any help would really be appreciated.

Cheers.

Share this post


Link to post
Share on other sites

Hi Rocky, thanks.

This is probably a real moron question, but how do I get the contents of the array?

{$cart->getProducts()} in the .tpl returns "Array". OK, I understand it's an array.

When I use {foreach $cart->getProducts()} the page falls over.

What am I doing wrong???

Thanks again for any help. This is driving me up the wall.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More