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

Diff of /contributions/modules/uc_node_checkout/uc_node_checkout.module

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

revision 1.8.2.6, Thu Jul 30 15:58:42 2009 UTC revision 1.8.2.7, Thu Jul 30 16:17:17 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: uc_node_checkout.module,v 1.8.2.5 2009/07/30 15:28:29 rszrama Exp $  // $Id: uc_node_checkout.module,v 1.8.2.6 2009/07/30 15:58:42 rszrama Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 304  function uc_node_checkout_form_alter(&$f Line 304  function uc_node_checkout_form_alter(&$f
304          drupal_goto('ucnc-select/'. $type);          drupal_goto('ucnc-select/'. $type);
305        }        }
306    
307          // If specified, put the default qty. in a hidden field.
308          if (!empty($_GET['qty']) && intval($_GET['qty']) > 0) {
309            $form['default_qty'] = array(
310              '#type' => 'hidden',
311              '#value' => intval($_GET['qty']),
312            );
313          }
314    
315        // If enabled, add attributes form to the top of the node form if the node        // If enabled, add attributes form to the top of the node form if the node
316        // has not already been checked out.        // has not already been checked out.
317        if (module_exists('uc_attribute') && empty($form['#node']->uc_order_product_id)) {        if (module_exists('uc_attribute') && empty($form['#node']->uc_order_product_id)) {
# Line 413  function uc_node_checkout_add_to_cart_su Line 421  function uc_node_checkout_add_to_cart_su
421    
422    $get = array('product_nid='. $form_state['values']['nid']);    $get = array('product_nid='. $form_state['values']['nid']);
423    
424      // Pass the qty. if specified.
425      if (!empty($form_state['values']['qty']) && intval($form_state['values']['qty']) > 0) {
426        $get[] = 'qty='. intval($form_state['values']['qty']);
427      }
428    
429    // Pass the attributes selections in the URL.    // Pass the attributes selections in the URL.
430    $attr = array();    $attr = array();
431    
# Line 535  function uc_node_checkout_nodeapi(&$node Line 548  function uc_node_checkout_nodeapi(&$node
548            $product->default_qty = 1;            $product->default_qty = 1;
549          }          }
550    
551            // Override the default qty. if specified.
552            if (intval($node->default_qty) > 0) {
553              $product->default_qty = intval($node->default_qty);
554            }
555    
556          // Build the preliminary add to cart data array.          // Build the preliminary add to cart data array.
557          $data = array('nid' => $product->nid, 'node_checkout_nid' => intval($node->nid));          $data = array('nid' => $product->nid, 'node_checkout_nid' => intval($node->nid));
558    

Legend:
Removed from v.1.8.2.6  
changed lines
  Added in v.1.8.2.7

  ViewVC Help
Powered by ViewVC 1.1.2