You are here

function uc_cart_checkout_form_cancel in Ubercart 7.3

Submit handler for "Cancel" button on uc_cart_checkout_form().

See also

uc_cart_checkout_form()

1 string reference to 'uc_cart_checkout_form_cancel'
uc_cart_checkout_form in uc_cart/uc_cart.pages.inc
The checkout form built up from the enabled checkout panes.

File

uc_cart/uc_cart.pages.inc, line 384
Cart menu items.

Code

function uc_cart_checkout_form_cancel($form, &$form_state) {
  $order = $form_state['storage']['order'];
  if (isset($_SESSION['cart_order']) && $_SESSION['cart_order'] == $order->order_id) {
    uc_order_comment_save($_SESSION['cart_order'], 0, t('Customer canceled this order from the checkout form.'));
    unset($_SESSION['cart_order']);
  }
  unset($_SESSION['uc_checkout'][$order->order_id]);
  $form_state['redirect'] = $form_state['storage']['base_path'];
}