"Add to cart" minimum order quantity I am using Ubercart 2 on Drupal 6 with http://drupal.org/project/uc_product_minmax. It works well, except for the fact that the default catalog only provides an 'Add to cart' button with no quantity field, and the quantity it adds is 1, which makes it useless as the minimum order quantity in this particular case is 2.

I have tried implementing hook_add_to_cart() to forcefully change $qty to 2 if it's lower only to find that I cannot manipulate it before uc_product_minmax implements the hook, so I'm in need of an alternative.

Maybe this isn't even fixable without modifying uc_product_minmax itself, but I'm up for trying any other ideas.
If you want to alter the cart item, then you can use hook_uc_cart_alter of ubercart.


  This is called every time the cart is rebuild (e.g. when products are
  added), so it's a good place to alter the cart item.


Code snippets to modify the qty of the item

/**
 * Implements uc_cart_alter.
 */
function mymodule_uc_cart_alter(&amp;$items ) {

  foreach ($items as $index =&gt; $item) {

   //you can add condition for your product

    $items[$index]-&gt;qty = 2;
  }
}


For reference:

http://www.ubercart.org/docs/api/hook_uc_cart_alter