/[drupal]/contributions/modules/uc_restrict_qty/uc_restrict_qty.module
ViewVC logotype

Diff of /contributions/modules/uc_restrict_qty/uc_restrict_qty.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.4.5.2.1, Mon Apr 13 11:13:42 2009 UTC revision 1.1.4.5.2.2, Mon Apr 13 11:21:15 2009 UTC
# Line 1  Line 1 
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
# Line 212  function uc_restrict_qty_form_alter(&$fo Line 212  function uc_restrict_qty_form_alter(&$fo
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    }    }

Legend:
Removed from v.1.1.4.5.2.1  
changed lines
  Added in v.1.1.4.5.2.2

  ViewVC Help
Powered by ViewVC 1.1.2