ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Using ProductCart
  New Posts New Posts RSS Feed - Minimum no. of units
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Minimum no. of units

 Post Reply Post Reply Page  123 4>
Author
Message
intour View Drop Down
Senior Member
Senior Member


Joined: 30-June-2006
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote intour Quote  Post ReplyReply Direct Link To This Post Topic: Minimum no. of units
    Posted: 07-July-2008 at 5:27am

I have a client who needs to set a minimum number of units to be ordered for retail customers.

A customer can order any combination of products but they must order a minumum number of 12.
 
Productcart allows a maximum number to be set so I'm hoping I can tweak the formula for this.
 
Is there anyone who has already done this or something similar?
 
Many thanks
 
Nigel
 
 
 


Edited by intour - 07-July-2008 at 5:27am
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 07-July-2008 at 7:56am
Hi Nigel,
      You can set a minimum number for particular products and a maximum number overall, but the code that checks the overall quantity has been exceeded is executed when products are added to the "cart".   To throw messages at that  point would probably become irritating to customers as, even when they know about the limit of 12  they would get the message until they reached the minimum of 12.

I think you will need to add code to the checkout process to check this to make this work OK.  It's an unusual requirement to have a minimum overall number of products I would have thought. Usually these things are achieved by having a minimum order value instead. Have you suggested this to your client as an alternative approach?


Back to Top
intour View Drop Down
Senior Member
Senior Member


Joined: 30-June-2006
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote intour Quote  Post ReplyReply Direct Link To This Post Posted: 07-July-2008 at 8:12am
Hi Hamish,
 
Thanks for your reply.
 
It's certainly not something I've been asked for before but I can wholly understand my clients request.
 
They are selling wine - you can buy a mixture of bottles - but the minimum amount is a case of 12 bottles.
 
Nigel
 
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 07-July-2008 at 9:06am
Ah, yes - I can see that's a perfect example of when it would be required :-). I suspect they would want to sell in multiples of either 6 or 12 with a minimum of twelve.

I'd be happy to help them test it :-) 
FYI - The code used for the maximum quantity appears in pc/instPrd.asp (& a couple of others) and is coded as follows :-
if countCartRows(pcCartArray, ppcCartIndex)=scQtyLimit then

Where scQtyLimit is the Maximum quantity value set via the  "Store Settings > Order & Customer  Related".

I think you should place your code where the related "Minimum Order Amount" rules are enforced. Note, there are separate limits for Wholesale and Retail cutomers.

For Wholsale customers there are more locations with associated code, but There are 5 files in the "pc" folder that contain the "scminpurchase" but the key one, I suspect, is checkout.asp, although I would check all of them if I were you. NOTE - The Wholesale minimum is referred to in a couple of other files as well.

In checkout.asp there is code at line 197 in the version I'm looking at (V3.11) :-

        if calculateCartTotal(pcCartArray, ppcCartIndex)<scMinPurchase then
        'Retail minimum not met, so customer cannot checkout -> show message
            response.redirect "msg.asp?message=206"
        end if

I would put the new code very near there.


Edited by Hamish - 07-July-2008 at 9:08am
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 07-July-2008 at 9:18am
Hi Nigel,
   Another possible issue - This is fine as long as each product is a bottle. It get's a lot messier, if not unworkable if they sell other products as well, or whole / half cases  as products. They may end up with an order for 10 bottles and two corkscrews, or 2 cases and 10 bottles. Unless they sell ONLY wine by the bottle and plan to continue doing so this will probably cause more problems than it will solve.

One way round this is to use BTO and set the "product" up as a case / half case.
That way the customer buys a case and then "configures" it by selecting all the individual bottles that make it up. Even this would need some custom work as you would want them to be able to select any mixture but have the total number of bottles in the case set as 6 or 12.
Alternatively make a custom version of the code that counts the products so that it only counts wine bottles.

The "best" answer depends hugely on how the store is configured as regards products / categories etc.  
Back to Top
intour View Drop Down
Senior Member
Senior Member


Joined: 30-June-2006
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote intour Quote  Post ReplyReply Direct Link To This Post Posted: 07-July-2008 at 9:34am
Hi Hamish,
 
Many thanks again for your replies.
 
They only sell bottles of wine and I think all the bottles are the same size so that, at least, is a good thing.
 
This may require a fair bit of custom coding to achieve and I don't think it's in their budget.
 
I'll put it to the client and see what response I get.
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 07-July-2008 at 10:00am
Hi,
  I don't think it would be much work - as long as they are happy that they will then be limited to just selling bottles, otherwise they would hit the issues I have described. For example - they may wish to sell single bottles of very expensive wine, or some of the larger bottle sizes.  Actually, it would be possible to have a minimum number of bottles (items) OR order value - but they then "risk" selling  a small number of high value items in a quantity less than 12.  It's up to them.
Back to Top
mattprice View Drop Down
Senior Member
Senior Member


Joined: 03-June-2007
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote mattprice Quote  Post ReplyReply Direct Link To This Post Posted: 07-July-2008 at 11:36am

Hi all,

When I purchased Productcart + BTO in July last year I paid Early Impact to add a minimum order quantity modification for me that made it independent of multiple order quantity.  At the moment when you set a min order qty and multiple order qty the two figures must be the same. They don't normally undertake mod work but like always they are incredibly helpful bunch.
 
This does not handle your mixed product (bottle) issue but it may be a step closer.  It used Javascript to force the minimum order quantity before checkout so you may be able to adapt the code.  You are welcome to my modified code, if interested drop me your contact details and I'll email you the files.  Problem is this was last July (around version 3.04 ish I think) and some of the common files have upgraded since.
 
I asked EI recently if they could implement the mod they made for me into the standard code but I think it is low priority because nobody has asked before.  We had quite specific reasons for adding this code but I imagine this could be useful to other users because minimum order quantity and multiple order quantity are two very different things and I dont think should be interlinked as they are now in PC.  A minimum order quantity often establishes the qty with which a store can sell a product at an acceptable margin but the multiple order quantity thereafter may be set for more practical reasons (eg the ease at which a product can be packed )
 
I dont have a site to show you I am afraid.  This site is still not live and after upgrading recently have not reimplemented the mod.
 
Matt
Back to Top
intour View Drop Down
Senior Member
Senior Member


Joined: 30-June-2006
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote intour Quote  Post ReplyReply Direct Link To This Post Posted: 07-July-2008 at 12:02pm
Hi Matt & Hamish,
 
Matt - Ive sent you a private message with my email address.
 
Hamish - I tried modifying the checkout.asp page. ProductCart has a bit of code there that redirects to a messsage from the language file if the cart is empty. It basically says that if the number of items in the cart = 0 then show the 'your cart is empty' message.
 
So I thought if I changed it to: < 12 and then changed the message to 'you need to order a minimum of 12' it might be  simple solution but it didnt work. It just kept throwing up the message no matter what I put in the cart. Theres bound to be another 'include' file in there somwhere that has a bearing on it - there always is !
 
ah well - back to the drawingboard for now.
 
Nigel
 


Edited by intour - 07-July-2008 at 12:04pm
Back to Top
mattprice View Drop Down
Senior Member
Senior Member


Joined: 03-June-2007
Location: United Kingdom
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote mattprice Quote  Post ReplyReply Direct Link To This Post Posted: 07-July-2008 at 1:11pm

Hi Nigel,

I have just emailed the files across to you now.  Good Luck.  Forgot to mention that EI made the mod compatible with BTO add on as well but these files can be comfortably split I think if you are not using this.
 
I had a look at updating the common files to latest rev but there are quite a few line additions on a few of the files and my head was getting dizzy even using a file comparison program.  This is why I was hoping EI would incorporate the mod into the mainstream release.
 
If you or Hamish (or any other developer reading) fancy taking on some paid for time in bringing this EI mod up to latest revision I would be interested.  It might even spur me on to get this project live after 12 months rather than letting it stagnate on the corner of my desk.
 
Cheers
Matt
Back to Top
 Post Reply Post Reply Page  123 4>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.