Jump to content
Latest News: (loading..)
RobertoRamaroson

Add option "Quota" for product

Recommended Posts

Hi,
I would like to add a quota option to a product, ie a customer can order only x products maximum. Who can help me please? I am using version 2.3.4.1

Share this post


Link to post
Share on other sites

not sure what version your running with but, this is available for 2.2 so will need updating for anythig else. Its probably a good start to see if you can get what you need.

Maximum Product Quantity with Admin

Failing that you can post in the commercial section and ask a developer to help. They may have what you need or may be able to update this for you.

 


I'm using the cutting Edge v2.3.4.1 CE:thumbsup::smile:

Get the latest osCommerce Online Merchant Community Bootstrap Edition v2.3.4.1 CE

 

Share this post


Link to post
Share on other sites

Before you get too far along with this, first make sure you're working from an up-to-date code base, which is osC 2.3.4.1BS Edge/CE/Frozen. The official 2.3.4.1 release is woefully obsolete and you shouldn't use it. I don't think what you're asking for is built in to any osC version, but you might as well start out with current code.

By the way, I don't know if you're a native English speaker, but "quota" usually is understood to be a minimum purchase quantity (something the customer needs to buy x of, or more commonly a sales person needs to sell x of), rather than a maximum limit on purchases. Keep this in mind during the discussion, as it could confuse people. I'm assuming you mean a "limit".

Limiting purchases of a given product is a bit unusual, although if that product is a bonus or freebie, or a loss-leader, it is understandable that you might want to do that. At least think about whether you should be charging more for the item, or running a limited-time sale instead, before trying to change code. If it's just a matter of running out of stock, you should be able to configure the store to not sell if stock goes to zero (or, issue a "rain check" for first dibs on the item when it's restocked). If the suggested add-on doesn't work (can't be updated) and you have to implement it from scratch, the first thing to consider is "x items per <time period>?". If per a single sale, adding a limit to how many can be in the shopping cart shouldn't be too hard. You could generalize this by adding a new column (field) to the product information table to define the limit, and use that in the code rather than a hard-coded limit.

If you want to limit sales to a customer over some period of time, you'll have to keep track of past sales per customer. Depending on how long this time period is, you might find it cleaner to have a new table of limited purchases in the database, with customer ID, product ID, date of purchase, and quantity entries. This, rather than going through recent sales records, which would have to be kept online. At checkout (also when the product is added to the cart, if the customer is logged in at this time), you could add up this customer's purchases in the table and decide how many are left in the quota. Don't forget to check the expiration date against the time limit, and first remove from the table any purchases that have expired. A lifetime limit would be the same, except you wouldn't have to track individual sales -- just the grand total this customer has purchased. Don't forget to delete or reduce entries upon merchandise returns.

To do it right won't be simple, but it is certainly possible. I don't think any of this should run afoul of GDPR and other privacy rules, but you will need to inform customers that you're keeping records on past purchases for a certain length of time. Also, this could be extended to classes of items (say, not just red glasses, green glasses, clear glasses, etc., but drinking glasses in general). That might be as simple as adding an item class field to the product information table, in addition to the limit and time period (then comes the issue of keeping item class time limits in synch with individual item time limits).


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Edge" release

Share this post


Link to post
Share on other sites
4 minutes ago, MrPhil said:

By the way, I don't know if you're a native English speaker, but "quota" usually is understood to be a minimum purchase quantity

:smile: I'm not a native English speaker as my mother tongue is geordie!  But man even I na that’s wong!!!

propa english https://dictionary.cambridge.org/dictionary/english/quota

quota noun [ C ]
uk /ˈkwəʊtə/ us

a fixed limit on the amount of something that someone is allowed

 

So it is the maximum :biggrin:

 

 


I'm using the cutting Edge v2.3.4.1 CE:thumbsup::smile:

Get the latest osCommerce Online Merchant Community Bootstrap Edition v2.3.4.1 CE

 

Share this post


Link to post
Share on other sites

Maybe that's British English usage, but it's not American English. If a salesperson has a sales quota, it's the minimum they're expected  to sell. A police officer with a quota of tickets to write is expected to issue at least that many tickets. Two peoples divided by a common language.


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Edge" release

Share this post


Link to post
Share on other sites

Pondering it some more, perhaps the problem is that Americans don't use "quota" consistently (yes, our educational system is dismal). A quota on immigrants from a certain country usually means a limit (maximum), while a university admissions quota on a certain group (e.g., Asians, Latinos) can be used as either a minimum or (somewhat more often) a maximum count -- reach that number, and no more.


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Edge" release

Share this post


Link to post
Share on other sites

OP needs to provide more details.

  • Is this a limit on each product per order?
    You can buy as much stuff as you want but a maximum of 6 of each item
     
  • Is this a limit per order?
    You can buy whatever you like, but only 6 in any one order.
     
  • Is this a limit per product per customer?
    You can buy whatever you like, but in your lifetime you can only buy 6 of Item A

And so on.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×