Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shopping cart


chfields

Recommended Posts

In my MS1 store the shopping cart does not appear until customer puts something in it. However, it doesn't do that in my MS2 store. I have the admin/config/my store/display cart after adding purchase=true in both stores. Anyone know how to get MS2 to hide cart until something is put into it??

Link to comment
Share on other sites

This is what I am using to do that:

// WebMakers.com Added: Only show shopping cart when there is something in it.

 if ($cart->count_contents() >= 1) {

   require(DIR_WS_BOXES . 'shopping_cart.php');

 }

Link to comment
Share on other sites

Although Lindas solution will work perfectly for most Shop Owners, there are some who sell less than a quantity of "1". eg lengths of wire or rope (one of my customers is in this position (he sells half lengths of pipe))...

 

So, a slightly more "all round" solution would be to go:

 

  if ($cart->count_contents() != 0) { 

   require(DIR_WS_BOXES . 'shopping_cart.php'); 

 }

 

As I say, it is almost exactly the same, but will deal with quantities less than "1".

 

hth.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...