Hi

Is it possible to do min/max per items in the cart??

How can we modify this module to check min/max per cart item, not just on total cart items?

For example, we do not want this cart to validate:
(assume minimum order is 20, using your module)
Product ABC - 5 items
Product XYZ - 23 items

But this cart should validate:
Product ABC - 25 items
Product XYZ - 23 items

I can envision a check for each item, then pass a flag as true or not. Any advice on how to proceed?

Comments

Cablestein’s picture

StatusFileSize
new10.89 KB

Okay I've created a solution... posting file.

I've never uploaded any code to Drupal before, I am not sure about procedure.

Anyhow here is an updated .module file for the "Ubercart Min/Max Order Quantity" module.

Changes:
-New fields in "admin/store/settings/cart" giving you control over min/max for item quantity (as opposed to just min/max on the total cart items, like the original module does).
-Function which makes an array of titles and quantities for every cart item.
-Loop which runs through the items and checks if they validate against the new min/max fields.

All changes surrounded by my comments ("Cablestein").

QUESTION: I am using the form names "uc_min_item" and "uc_max_item". Is it possible that can conflict with UC core or other UC modules?

Cablestein’s picture

Category: task » feature
Priority: Normal » Major
bgetkin’s picture

StatusFileSize
new66.5 KB

I need to set minimum quantity on a per product basis. Some items need to be set to a minimum quantity of 1, while others may be 100. I've installed your mod, but do not see any fields besides those specific to the cart on this page admin/store/settings/cart/edit, see attached. What am I missing?

Any help would be very appreciated.

Thank you.

Cablestein’s picture

This thread is about product min/max per item in the cart.

For min/max on a per product basis, I am using this module. The dev version, yes, but seems to work so far.
http://drupal.org/project/uc_product_minmax

Once installed, look into "Product Features". You may have to enable product features in UC config somewhere, otherwise just go straight to a product, hit Edit, then there'll be a second sub-menu tab near the top called "Features", in there you can add a new feature.

Cablestein’s picture

StatusFileSize
new2.89 KB

Here is an updated zip. I realize this is totally against Drupal procedures. I'm learning =).

This updated zip fixes some bugs.

rdeboer’s picture

Thanks Cablestein... Will have a look and see if we can make it available as a dev release.

basirmukhtar’s picture

Lets say we have three products in store and we limit our cart check out to only 1 product. what i want is when user add one product to cart then after this users cant add more products to cart.