Révision dbb0c974
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/commerce/modules/cart/commerce_cart.module | ||
---|---|---|
12 | 12 |
define('COMMERCE_CART_REFRESH_ALWAYS', 'always'); |
13 | 13 |
define('COMMERCE_CART_REFRESH_OWNER_ONLY', 'owner_only'); |
14 | 14 |
define('COMMERCE_CART_REFRESH_ACTIVE_CART_ONLY', 'active_cart_only'); |
15 |
define('COMMERCE_CART_REFRESH_DEFAULT_FREQUENCY', 15); |
|
15 | 16 |
|
16 | 17 |
/** |
17 | 18 |
* Implements hook_menu(). |
... | ... | |
106 | 107 |
|
107 | 108 |
// Returns TRUE if the link is enabled via the order settings form and the |
108 | 109 |
// user has access to update the order. |
109 |
return variable_get('commerce_order_apply_pricing_rules_link', TRUE) && commerce_order_access('update', 3);
|
|
110 |
return variable_get('commerce_order_apply_pricing_rules_link', TRUE) && commerce_order_access('update', $order);
|
|
110 | 111 |
} |
111 | 112 |
|
112 | 113 |
/** |
... | ... | |
379 | 380 |
'#type' => 'textfield', |
380 | 381 |
'#title' => t('Shopping cart refresh frequency'), |
381 | 382 |
'#description' => t('Shopping carts will only be refreshed if more than the specified number of seconds have passed since they were last refreshed.'), |
382 |
'#default_value' => variable_get('commerce_cart_refresh_frequency', 30),
|
|
383 |
'#default_value' => variable_get('commerce_cart_refresh_frequency', COMMERCE_CART_REFRESH_DEFAULT_FREQUENCY),
|
|
383 | 384 |
'#required' => TRUE, |
384 | 385 |
'#size' => 32, |
385 | 386 |
'#field_suffix' => t('seconds'), |
... | ... | |
663 | 664 |
// Build the variables array to send to the cart block template. |
664 | 665 |
$variables = array( |
665 | 666 |
'order' => $order, |
666 |
'contents_view' => commerce_embed_view('commerce_cart_block', 'defaults', array($order->order_id), $_GET['q']),
|
|
667 |
'contents_view' => commerce_embed_view('commerce_cart_block', 'default', array($order->order_id), $_GET['q']), |
|
667 | 668 |
); |
668 | 669 |
|
669 | 670 |
$content = theme('commerce_cart_block', $variables); |
... | ... | |
721 | 722 |
} |
722 | 723 |
|
723 | 724 |
// Check to see if the last cart refresh happened long enough ago. |
724 |
$seconds = variable_get('commerce_cart_refresh_frequency', 15);
|
|
725 |
$seconds = variable_get('commerce_cart_refresh_frequency', COMMERCE_CART_REFRESH_DEFAULT_FREQUENCY);
|
|
725 | 726 |
|
726 | 727 |
if (!empty($seconds) && !empty($order->data['last_cart_refresh']) && |
727 | 728 |
REQUEST_TIME - $order->data['last_cart_refresh'] < $seconds) { |
Formats disponibles : Unified diff
Weekly update of contrib modules