Guest Posted April 21, 2008 Share Posted April 21, 2008 I have a little shopping cart design on my non-osc index page, similar to the one in the catalog, "you have # items in your cart." I need to get the "#" to be the real number of items in the cart...activate it, basically. What reference to the shopping_cart.php should I use? I figure something like this: <tr><td colspan=2 class=ch1>You currently have <b><a class=ml1 href=http://mysite.com/catalog/shopping_cart.php> items</a></b></td></tr> but I just can't get it to work. Am I even close?? Thanks for any help. Link to comment Share on other sites More sharing options...
burt Posted April 21, 2008 Share Posted April 21, 2008 cart->count_contents() I wrote a bit about it (including code example) at http://www.clubosc.com/how-to-show-number-...ts-in-cart.html Link to comment Share on other sites More sharing options...
Guest Posted April 21, 2008 Share Posted April 21, 2008 Thanks Burt..still close...does the index.htm page (and other pages with this) need to actually be in the catalog folder (I guess I'd use a redirect from www.mysite.com to www.mysite/catalog/index.htm, or something like that)? My non-osc pages are in the public_html. <td width="94%"><b><font size="1">You have <?php echo $cart->count_contents(); ?> items in your cart.<td width="3%"> </td> </tr> Link to comment Share on other sites More sharing options...
Guest Posted April 22, 2008 Share Posted April 22, 2008 alright, sorry to double post. <tr> <td width="3%"> </td> <td width="94%"><font size="1">You have <a class=ml1 href="http://mysite.com/catalog/shopping_cart.php?"> echo $cart->count_contents(); item(s)</a> in your cart.<td width="3%"></td> </tr> </table> I've been trying stuff like this for hours and it just ain't happening. it displays "item(s)" as a link to the shopping cart, but no qty in front. any ideas??? Link to comment Share on other sites More sharing options...
arietis Posted April 23, 2008 Share Posted April 23, 2008 alright, sorry to double post. I've been trying stuff like this for hours and it just ain't happening. it displays "item(s)" as a link to the shopping cart, but no qty in front. any ideas??? you need to use php to get this to work, so change it to: <td width="94%"><font size="1">You have <a class=ml1 href="http://mysite.com/catalog/shopping_cart.php?"><?php echo $cart->count_contents(); ?> item(s)</a> Link to comment Share on other sites More sharing options...
Guest Posted April 23, 2008 Share Posted April 23, 2008 dave, that's what I have up now (I'll im you my test site), but i still get what's pictured above. It seems the > (after "$cart-") cuts the php code short. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.