diff --git a/modules/checkout/commerce_checkout.module b/modules/checkout/commerce_checkout.module index f0fdd87..84d4717 100644 --- a/modules/checkout/commerce_checkout.module +++ b/modules/checkout/commerce_checkout.module @@ -15,6 +15,7 @@ function commerce_checkout_menu() { $items['checkout/%commerce_order'] = array( 'title' => 'Checkout', + 'load arguments' => array(FALSE), 'page callback' => 'commerce_checkout_router', 'page arguments' => array(1), 'access arguments' => array('access checkout'), @@ -23,6 +24,7 @@ function commerce_checkout_menu() { ); $items['checkout/%commerce_order/%commerce_checkout_page'] = array( 'title' => 'Checkout', + 'load arguments' => array(FALSE), 'page callback' => 'commerce_checkout_router', 'page arguments' => array(1, 2), 'access arguments' => array('access checkout'), diff --git a/modules/checkout/includes/commerce_checkout.pages.inc b/modules/checkout/includes/commerce_checkout.pages.inc index bbb2a06..14c4052 100644 --- a/modules/checkout/includes/commerce_checkout.pages.inc +++ b/modules/checkout/includes/commerce_checkout.pages.inc @@ -351,9 +351,6 @@ function commerce_checkout_form_validate($form, &$form_state) { function commerce_checkout_form_submit($form, &$form_state) { $checkout_page = $form_state['checkout_page']; - // Load a fresh copy of the order stored in the form. - $order = commerce_order_load($form_state['order']->order_id); - // If we are going to redirect with checkout pane messages stored in the form // state, they will not be displayed on a subsequent form build like normal. // Move them out of the form state messages array and into the current @@ -368,6 +365,9 @@ function commerce_checkout_form_submit($form, &$form_state) { if (end($form_state['triggering_element']['#array_parents']) == 'continue') { // If there is another checkout page... if ($checkout_page['next_page']) { + // Load a fresh copy of the order stored in the form. + $order = commerce_order_load($form_state['order']->order_id); + // Update the order status to reflect the next checkout page. $order = commerce_order_status_update($order, 'checkout_' . $checkout_page['next_page'], FALSE, NULL, t('Customer continued to the next checkout page via a submit button.'));