Limiting Quantity Per Product


https://forum.kartris.com/Topic3084.aspx
Print Topic | Close Window

By djjohnson - Thu 22 May 2014
Does anyone know how to limit the quantity in cart and add to cart to 1 per product? Or do I need to write custom code to accomplish this? I have already added IsService to the product in the tblKartrisObjectConfig to control if they can order more than 1 product at a time. I added it to the product level because all versions are still a service that should only allow 1 as the quantity per product that IsService.
By Paul - Sun 25 May 2014
There isn't presently a way to limit a product to one per basket. I think the closest that could be done without modification is to set stock tracking on and only have one item in stock. If someone tried to add more, it would prevent them and tell them there is only one in stock. You could change that message. Obviously it's not perfect, you'd need to reset the stock back to one after a purchase.

But you could modify the basketBLL to support this, I don't think it's a huge job. If you're not using stock tracking elsewhere, you could modify the checkout so as not to adjust stock levels down after purchase. Or otherwise, you could add a new object config setting to products, and then if this was set to true, pick that up in the basketBLL and only allow the quantity for that item to be 1.