Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

simple shopping_cart.php qty link


Guest

Recommended Posts

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

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.

 

cart.png

 

<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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...