Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Number of cart items


watercolourman

Recommended Posts

Posted

Hi Guys,

Is their anyway I can limit the number of items that a client can add to the cart to just 1 item.

 

I would be grateful for any suggestions.

 

Many thanks,

 

Brian

Posted

Hi Guys,

Is their anyway I can limit the number of items that a client can add to the cart to just 1 item.

 

/quote]

 

 

Lol sorry sure you have a serious reason but just gave me a giggle as most of us spend our time trying to persuade our customers to put more items in the cart :lol:

 

Out of interest, why?

Posted

if you want to restrict just the quantity to 1 (not the number of different products) then you can change the shopping_cart class file, function update_quantity

 

below this:

	function update_quantity($products_id, $quantity = '', $attributes = '') {
  global $customer_id;

 

add

return;

 

However you do need to add some code to display an error if someone tries to update the quantity or add the same product to the cart more than once. Also the above won't work with different attributes as those are treated like different products.

Posted

Hi Madcrazygirl,

I never thought of it like that but yes it is unusual, it is just that I sell fairly expensive antique paintings, very few people are going to want more than one at any time and there is also a hassle with the shipping that changes it to zero when an additional item is added, so ONE ITEM IT IS!! I think I have found a mod that will give me the ability to set any number from 1 to infinity!

 

Regards,

 

Brian

 

Also many thanks to you enigma1 for your suggestion I may try that option if the mod I have found does not work.

 

Brian

Posted
Hi Madcrazygirl,

very few people are going to want more than one at any time and there is also a hassle with the shipping that changes it to zero when an additional item is added, so ONE ITEM IT is

 

Brian

 

None of my business really ;) but now you have said why, you say 'very few' but you will never know how many if you issue a rationing system? Customers are funny creatures so you never can tell. Aren't there interior designers with big budgets and wealthy people furnishing a room who want more than one?

 

Biggest risk is that you may simply annoy them by refusing to allow buying more than one and then they may not even buy the one.

 

You mention that the reason for doing this is because of the shipping but would it not be simpler just to change this?

 

Sorry just my thoughts.......

 

Best wishes x

Archived

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

×
×
  • Create New...