You are here

function commerce_checkout_pane_callback in Commerce Core 7

Returns the specified callback for the given checkout pane if it's available, loading the checkout pane include file if specified.

Parameters

$checkout_pane: The checkout pane array.

$callback: The callback function to return, one of:

  • settings_form
  • checkout_form
  • checkout_form_validate
  • checkout_form_submit
  • review

Return value

A string containing the name of the callback function or FALSE if it could not be found.

5 calls to commerce_checkout_pane_callback()
CommerceCheckoutTestProcess::testCommerceCheckoutValidatePanesAnonymousUser in modules/checkout/tests/commerce_checkout.test
Test the checkout validation panes with anonymous user.
commerce_checkout_form in modules/checkout/includes/commerce_checkout.pages.inc
Builds the checkout form for the given order on the specified checkout page.
commerce_checkout_form_validate in modules/checkout/includes/commerce_checkout.pages.inc
Validate handler for the continue button of the checkout form.
commerce_checkout_pane_settings_form in modules/checkout/includes/commerce_checkout.admin.inc
Build the configuration form for a checkout pane.
commerce_checkout_review_pane_checkout_form in modules/checkout/includes/commerce_checkout.checkout_pane.inc
Checkout pane callback: returns a pane allowing the customer to review the details of the order.

File

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

Code

function commerce_checkout_pane_callback($checkout_pane, $callback) {

  // Include the checkout pane file if specified.
  if (!empty($checkout_pane['file'])) {
    $parts = explode('.', $checkout_pane['file']);
    module_load_include(array_pop($parts), $checkout_pane['module'], implode('.', $parts));
  }

  // If the specified callback function exists, return it.
  if (!empty($checkout_pane['callbacks'][$callback]) && is_callable($checkout_pane['callbacks'][$callback])) {
    return $checkout_pane['callbacks'][$callback];
  }

  // Otherwise return FALSE.
  return FALSE;
}