| 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 |
| 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)) { |
| 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 |
|
|
| 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 |
|
|