You are here

function commerce_checkout_complete in Commerce Core 7

Completes the checkout process for the given order.

5 calls to commerce_checkout_complete()
CommerceCheckoutTestProcess::testCommerceCheckoutProgrammaticCheckout in modules/checkout/tests/commerce_checkout.test
Test programmatic checkout completion.
commerce_checkout_complete_form_submit in modules/checkout/includes/commerce_checkout.admin.inc
Form submit callback for commerce_checkout_complete_form().
commerce_checkout_form_submit in modules/checkout/includes/commerce_checkout.pages.inc
Submit handler for the continue button of the checkout form.
commerce_checkout_rules_complete_checkout in modules/checkout/commerce_checkout.rules.inc
Action callback: completes checkout for the given order.
commerce_payment_redirect_pane_next_page in modules/payment/commerce_payment.module
Moves an order ahead to the next page via an order update and redirect.
2 string references to 'commerce_checkout_complete'
commerce_checkout_complete_rules in modules/checkout/includes/commerce_checkout.admin.inc
Builds the checkout completion Rules Overview page.
commerce_checkout_form_commerce_checkout_add_complete_rule_form_alter in modules/checkout/commerce_checkout.module
Implements hook_form_FORM_ID_alter().

File

modules/checkout/commerce_checkout.module, line 974
Enable checkout as a multi-step form with customizable pages and a simple checkout pane API.

Code

function commerce_checkout_complete($order) {

  // An order could complete the checkout process more than once for a variety
  // of reasons, including administrators making changes. We want to keep the
  // timestamp from when the order was originally placed, so we don't update it
  // if it is already set.
  if (empty($order->placed)) {
    $order->placed = REQUEST_TIME;
  }
  rules_invoke_all('commerce_checkout_complete', $order);
}