| Project: | Product Minimum for Checkout |
| Component: | Code |
| Category: | |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Project:
Product Minimum In uc_product_min.module, I added:
if (preg_match('/.*add-to-cart-form.*/', $form_id)) {
$form['qty']['#default_value'] = !empty($node->product_min) ? $node->product_min : 1;
}At line 71, so it now reads:
function uc_product_min_form_alter($form_id, &$form) {
$node = $form['#node'];
$product_types = uc_product_node_info();
if (preg_match('/.*add-to-cart-form.*/', $form_id)) {
$form['qty']['#default_value'] = !empty($node->product_min) ? $node->product_min : 1;
}
if ($form_id == $node->type .'_node_form' && isset($product_types[$node->type])){This enables the default minimum to be set prior to check-out. Users can still choose less, and the logic to limit this upon checkout is still there.

