Limit max order quantity by product or product type?

Posted by Community Admin on 05-Aug-2018 23:33

Limit max order quantity by product or product type?

All Replies

Posted by Community Admin on 26-Jan-2012 00:00

Does anyone know if it's possible to limit product quantities to one per order?  I have a number Video-on-Demand products and ordering more than one of a given title doesn't make much sense.

Thanks -- Steve

Posted by Community Admin on 27-Jan-2012 00:00

Hey Steve,

Yup - me again, sorry... but you sure do know how to ask the fun questions don't you?

By default atm, I believe it's not possible to do this through a setting, but as I said in the other reply - give me time this weekend to plow through the system ok? Initial thoughts would be:

To restrict quantity on Product Detail page
Easiest would be to extend the 'Accept Terms' javascript with a few lines to set the quantity textbox to read-only. This ensures that no more than 1 product can be added to the shopping cart at a time.

To restrict quantity on Shopping cart overview
Easiest (I hope) will be to override the quantity validator when it is the a product from the specific product type (either thru backend product-type or custom field). This would make sure that no more than 1 product per order can be purchased.

To restrict buying again
If the above idea doesn't work, we're in trouble :) Since at the time of the shoppingcart no order has been created, there's no verification towards the user possible. So this can only happen after the shipping/billing details have been entered. At that moment the system knows if it is an 'anonymous' check out or a 'logged-in-user' checkout.

Anonymous check outs aren't linked to a profile, but for the logged-in checkout, we could back-track purchase history to see if the client already bought this product.

---
Since it's weekend, I'm gonna dabble with the first and second one, and hopefully have some good news Sunday evening...

Jochem.

Posted by Community Admin on 28-Jan-2012 00:00

Hi Jochem,

It's me who should apologize ;).  I don't think disabling the quantity text box will work since it would possible for for the user to add duplicates by adding the same title more than once. 

The "To restrict quantity on Shopping cart overview" approach might work but it's odd from a user perspective to flag a quantity validation problem this late in the order process.  Ideally, there should be a product "Limit Quantity" property.  This is pretty standard fare so it's odd to me that the feature doesn't alread exist.

As far as repeat orders go; I'm not too concerned about these since there might be a reason for a user re-order at a later date.

Thanks--Steve 

Posted by Community Admin on 28-Jan-2012 00:00

From a retail perspective limiting your sales is the most stupid thing you can do, so I'm guessing the team just hasn't gotten round to that yet :) 

You said that the "shopping cart overview" approach is odd/late from a user perspective. I agree it would be nicer if there was a clean (sitefinity) solution. But since this is the overview before starting the check out process, it's not that weird.

The main reason I suggested it was, to avoid 'breaking open' another part of the eCommerce system - the 'Buy Now' widget. By just installing the check on the product detail page, users will still be able to circumvent your limitation if you ever drop a buy now widget in...

---
Anyway, since you're opting for purely a product detail limitation check I believe the best route to go is with a code behind.

First check if the product-detail is showing a product of the specific type.
On product detail widget load, you grab the Shoppingcart cookie.
You trace the cookie back to the [sf_ec_cart_detail] table as the [cart_order_id] which should give you a list of product_id's.

If one of them matches the current product_id (shown in the detail template) than you can disable the 'add to cart' button. If there's no match, then override the quantity field to allow a maximum of one.

Jochem.

Posted by Community Admin on 31-Aug-2012 00:00

I have a similar question for you...or an opposite question actually.I would like to force a minimum order quantity for a product.  Is this somethign feasible?
Thanks!
Olivier

Posted by Community Admin on 31-Aug-2012 00:00

(sorry for the double post - the system gave an error and I don't know how to delete the second one)
I have a similar question for you...or an opposite question actually.I would like to force a minimum order quantity for a product.  Is this somethign feasible?
Thanks!
Olivier

Posted by Community Admin on 31-Aug-2012 00:00

Hey Olivier,

Are you talking about forcing a minimum when adding to the shopping cart or forcing a minimum before being allowed to proceed to the checkout?

Jochem

Posted by Community Admin on 31-Aug-2012 00:00

Hi Jochem.
No, what I am looking for is a way to enforce minimum quantity of a particular item.
For example, you can order product A in any quantity, but minimum of 5.

Thanks for your help,
Olivier

Posted by Community Admin on 31-Aug-2012 00:00

Hey Olivier,

I just meant it as should the check happen when I'm on product detail page and click 'add to cart' or should the check happen when 'proceed to checkout'. Depends on what you define as 'order'.

The big difference here is that 'add to cart' sees a product as 1 item, but if an item is already in the cart and you add the same item but in different language or through a 'buy now' widget or with a discount, Sitefinity considers it as a different product.

---
A custom field 'MimumOrderAmount' and custom validation on the product detail widget could do the trick. These two posts should get you more than started
http://www.sitefinity.com/devnet/forums/sitefinity-4-x/e-commerce/reset-order-number-and-add-in-an-accept-terms-and-conditions-button.aspx 
http://www.sitefinity.com/devnet/forums/sitefinity-4-x/e-commerce/possible-to-force-acceptance-of-terms-and-conditions-before-adding-a-product-type-to-cart.aspx 

Jochem


Posted by Community Admin on 31-Aug-2012 00:00

Good point you make there Jochem!  I did not even think about this.
I guess the ideal situation would be to check when the person adds the item that the quantity meets the minimum, but also at the checkout to ensure the quantity is still there.
I will look at the posts you provided to see how I can implement this type of mechanism in the Add to Cart.  For the Check out, I think I know what I can try.

Thanks a lot fory our help. 
Olivier

Posted by Community Admin on 06-Sep-2017 00:00

Hello All,

I am looking for some suggestion to restrict the product count in cart. What would happen when the cart is merged for an user  who has added products as guest but later logged in as registered user with few products already in his / her cart and merging both the carts will exceed the restricted count?.

This thread is closed