X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Limiting Number of Products in Single Purchase (https://forum.x-cart.com/showthread.php?t=3456)

Jason Brice 07-04-2003 03:26 PM

Limiting Number of Products in Single Purchase
 
Hi,

I'd like to be able to set up a product so that a customer may only order a maximum of two of them in a single order, regardless of the number of them in stock. How could I do this?

funkydunk 07-04-2003 11:47 PM

in customer/cart.php

change:

Code:

if (($cart["products"][$k]["amount"] >=1) && ($distribution))               
                                                {$cart["products"][$k]["amount"]=1; $amount=0;}
                                        $cart["products"][$k]["amount"] += $amount;


to:

Code:

if (($cart["products"][$k]["amount"] >=1) && ($distribution))               
                                                {$cart["products"][$k]["amount"]=1; $amount=0;}
                                        if ($cart["products"][$k]["amount"] >=2)
                                                {$cart["products"][$k]["amount"] = 2; $amount=0;}
                                        $cart["products"][$k]["amount"] += $amount;


Please note this code is for 3.4.2

Jason Brice 07-05-2003 01:37 PM

Just to complicate things - there only a couple of items out of about 10,000 that need this treatment, and it will change every month. Any way of doing it without hardcoding them in?

funkydunk 07-05-2003 10:58 PM

Not without a shed load of work I am afraid.

Would need to create an extra field in the products table to hold the max order amount and alter all the cart functions, display functions and modify product functions to read this.

NuAlpha 07-17-2004 11:39 AM

I would also like to see this. Maybe in a future release of 4.0?

We have about 20 products out of about 20,000 which are made on demand. Supply is unlimited, but only about 10 of each product are ever on hand at any given time and ordering much more than 10 of any one could over-take the ability to supply them.

Would be nice to have a feature like this. Maybe I should post under Wishlist? :wink:

adpboss 07-17-2004 03:30 PM

Agreed, one should be able to set the MAX and MIN purchase amounts. While we are at it, I would love to see a "quick update" product page with price, list price, max, min, avail, forsale etc. No images, no categories, no fluff.

Just a list of products so you can update the fields used most often when current stock editing.

groovico 07-18-2004 09:41 AM

Yeah had a few clients ask for this one too.

It's very useful for limited edition stock too. As in

Example you have 100 items of this but you may only order a max of 2 per order/customer. Same way supermarkets do it.

ddmitche 10-03-2004 01:18 PM

any success
 
I saw this thread and wondered if xcart had moved on anything, or if anyone else has had some success with it.

EnriqueHavoc 08-05-2005 02:31 PM

"Max order amount" would be a good feature to add to a future version of xcart.

salsabeel 09-16-2005 04:34 AM

Any update to this for 4.0?


All times are GMT -8. The time now is 09:53 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.