Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Limiting Number of Products in Single Purchase

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-04-2003, 03:26 PM
 
Jason Brice Jason Brice is offline
 

Advanced Member
  
Join Date: Mar 2003
Location: Christchurch, New Zealand
Posts: 42
 

Default 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?
Reply With Quote
  #2  
Old 07-04-2003, 11:47 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 07-05-2003, 01:37 PM
 
Jason Brice Jason Brice is offline
 

Advanced Member
  
Join Date: Mar 2003
Location: Christchurch, New Zealand
Posts: 42
 

Default

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?
Reply With Quote
  #4  
Old 07-05-2003, 10:58 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

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.
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 07-17-2004, 11:39 AM
 
NuAlpha NuAlpha is offline
 

X-Adept
  
Join Date: Aug 2003
Location: US
Posts: 598
 

Default

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?
__________________
X-Cart Pro 4.5.5 Platinum
X-Payments 1.0.6
PHP 5.3.14
MySQL 5.1.68
Apache 2.2.23
Reply With Quote
  #6  
Old 07-17-2004, 03:30 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

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.
Reply With Quote
  #7  
Old 07-18-2004, 09:41 AM
  groovico's Avatar 
groovico groovico is offline
 

X-Man
  
Join Date: Apr 2003
Location: Firetanksoftware.com
Posts: 2,326
 

Default

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.
__________________
Groovico

Used by X-carters the world over:
Marketing Manager Pro Bundle For X-cart
Featured Product Manager for X-cart
Feed manager pro for X-cart

http://www.firetanksoftware.com

Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X
Reply With Quote
  #8  
Old 10-03-2004, 01:18 PM
 
ddmitche ddmitche is offline
 

Newbie
  
Join Date: Oct 2004
Posts: 5
 

Default any success

I saw this thread and wondered if xcart had moved on anything, or if anyone else has had some success with it.
__________________
d@spyfx.com
_________

X-Cart version 3.5.11
PHP 4.1.2
MySQL server 4.0.20-standard
Reply With Quote
  #9  
Old 08-05-2005, 02:31 PM
  EnriqueHavoc's Avatar 
EnriqueHavoc EnriqueHavoc is offline
 

eXpert
  
Join Date: Jul 2004
Posts: 232
 

Default

"Max order amount" would be a good feature to add to a future version of xcart.
__________________
X-Cart 4.0.12
PHP 4.3.11
MySQL 4.0.23
Linux/Apache
Net::SSLeay 1.25
libCURL libcurl/7.12.0 OpenSSL/0.9.7a zlib/1.1.4
www.ewdhosting.com
Reply With Quote
  #10  
Old 09-16-2005, 04:34 AM
 
salsabeel salsabeel is offline
 

Senior Member
  
Join Date: Jan 2004
Posts: 132
 

Default

Any update to this for 4.0?
__________________
X-Cart Platinum 4.6.5
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:58 AM.

   

 
X-Cart forums © 2001-2020