function commerce_reorder_reorder_callback in Commerce Reorder 7
Same name and namespace in other branches
- 7.2 commerce_reorder.module \commerce_reorder_reorder_callback()
Perform the reorder action for the operations menu
1 string reference to 'commerce_reorder_reorder_callback'
- commerce_reorder_menu in ./
commerce_reorder.module - Implementation of hook_menu
File
- ./
commerce_reorder.module, line 66 - Allows users to create a new order from their order history.
Code
function commerce_reorder_reorder_callback($order) {
if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'commerce_reorder:' . $order->order_id) || !commerce_order_access('view', $order)) {
return MENU_ACCESS_DENIED;
}
commerce_reorder_helper($order);
drupal_set_message(t('Order copied to your cart.'));
// Redirect to the checkout with the new cart.
drupal_goto('cart');
}