Criterion Posted August 16, 2010 Share Posted August 16, 2010 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. Link to comment Share on other sites More sharing options...
e-motostore Posted August 16, 2010 Share Posted August 16, 2010 Maybe you could have a look at displaySummary function in order.php and shopping-cart.tpl if my memory is good you should find what you want Link to comment Share on other sites More sharing options...
Criterion Posted August 17, 2010 Author Share Posted August 17, 2010 Excellent. Thanks. I'm going through it now. Link to comment Share on other sites More sharing options...
Criterion Posted August 19, 2010 Author Share Posted August 19, 2010 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. Link to comment Share on other sites More sharing options...
rocky Posted August 19, 2010 Share Posted August 19, 2010 Looking at the code, it seems you should use $cart->getProducts() Link to comment Share on other sites More sharing options...
Criterion Posted August 19, 2010 Author Share Posted August 19, 2010 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. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted August 19, 2010 Share Posted August 19, 2010 Put 2 and 2 together: {foreach from=$cart->getProducts() item=product name=productLoop} Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now