You are here

function commerce_checkout_first_checkout_page in Commerce Core 7

Returns the page ID of the first checkout page to be used.

1 call to commerce_checkout_first_checkout_page()
commerce_checkout_commerce_order_state_info in modules/checkout/commerce_checkout.module
Implements hook_commerce_order_state_info().

File

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

Code

function commerce_checkout_first_checkout_page() {

  // See if any modules return a page ID first.
  $page_id = module_invoke_all('commerce_checkout_first_checkout_page');

  // If we received a return value from the hook, use the first item in the
  // return array as the page ID.
  if (!empty($page_id)) {
    return reset($page_id);
  }

  // Otherwise fallback to the first page defined in checkout form.
  $keys = commerce_checkout_pages();
  reset($keys);
  return key($keys);
}