| 1 |
<?php |
<?php |
| 2 |
// $Id: uc_node_checkout.module,v 1.8.2.2 2009/01/29 17:47:51 rszrama Exp $ |
// $Id: uc_node_checkout.module,v 1.8.2.3 2009/01/29 21:03:59 rszrama Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 133 |
} |
} |
| 134 |
|
|
| 135 |
/** |
/** |
| 136 |
|
* Implementation of hook_exit(). |
| 137 |
|
*/ |
| 138 |
|
function uc_node_checkout_exit() { |
| 139 |
|
global $base_root; |
| 140 |
|
|
| 141 |
|
// Prevent node checkout pages from being cached. |
| 142 |
|
$pages = array('node/add', 'ucnc-select'); |
| 143 |
|
$this_page = request_uri(); |
| 144 |
|
foreach ($pages as $page) { |
| 145 |
|
if (strstr($this_page, $page) !== FALSE) { |
| 146 |
|
cache_clear_all($base_root . $this_page, 'cache_page'); |
| 147 |
|
return; |
| 148 |
|
} |
| 149 |
|
} |
| 150 |
|
} |
| 151 |
|
|
| 152 |
|
/** |
| 153 |
* Implementation of hook_user(). |
* Implementation of hook_user(). |
| 154 |
*/ |
*/ |
| 155 |
function uc_node_checkout_user($op, &$edit, &$user, $category = NULL) { |
function uc_node_checkout_user($op, &$edit, &$user, $category = NULL) { |
| 191 |
|
|
| 192 |
// Alters the product add to cart forms to redirect to the appropriate node |
// Alters the product add to cart forms to redirect to the appropriate node |
| 193 |
// add form if enabled. |
// add form if enabled. |
| 194 |
if (strpos($form_id, 'add_to_cart_form') > 0 && variable_get('uc_node_checkout_add_to_cart_node_form', TRUE)) { |
if (variable_get('uc_node_checkout_add_to_cart_node_form', TRUE) && |
| 195 |
|
(strpos($form_id, 'add_to_cart_form') > 0 || strpos($form_id, 'uc_catalog_buy_it_now_form_') === 0)) { |
| 196 |
// If a node type association exists for this product... |
// If a node type association exists for this product... |
| 197 |
if ($type = uc_node_checkout_node_type_association($form['nid']['#value'])) { |
if ($type = uc_node_checkout_node_type_association($form['nid']['#value'])) { |
| 198 |
// Store the node type in the form. |
// Store the node type in the form. |