| 1 |
<?php |
<?php |
| 2 |
// $Id: uc_restrict_qty.module,v 1.1.4.5 2009/01/20 16:23:15 rszrama Exp $ |
// $Id: uc_restrict_qty.module,v 1.1.4.5.2.1 2009/04/13 11:13:42 mrfelton Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 212 |
if ($form_id == 'uc_cart_view_form') { |
if ($form_id == 'uc_cart_view_form') { |
| 213 |
for ($i = 0, $j = count(uc_cart_get_contents()); $i < $j; $i++) { |
for ($i = 0, $j = count(uc_cart_get_contents()); $i < $j; $i++) { |
| 214 |
$data = unserialize($form['items'][$i]['data']['#value']); |
$data = unserialize($form['items'][$i]['data']['#value']); |
| 215 |
|
|
| 216 |
// If this item has a quantity restriction on it... |
// If this item has a quantity restriction on it... |
| 217 |
if ($data['restrict_qty'] > $data['restrict_qty']) { |
if ($data['restrict_qty'] == 1) { |
| 218 |
$form['items'][$i]['qty']['#type'] = 'value'; |
$form['items'][$i]['qty']['#type'] = 'value'; |
| 219 |
$form['items'][$i]['qty']['#theme'] = 'restrict_qty_field'; |
$form['items'][$i]['qty']['#theme'] = 'restrict_qty_field'; |
| 220 |
} |
} |
| 221 |
} |
} |
| 222 |
} |
} |
| 223 |
|
|
| 224 |
if ($form_id == 'uc_product_feature_settings_form') { |
if ($form_id == 'uc_product_feature_settings_form') { |
| 225 |
$form['#validate'][] = 'uc_restrict_qty_settings_validate'; |
$form['#validate'][] = 'uc_restrict_qty_settings_validate'; |
| 226 |
} |
} |