Create a custom commerce checkout pane


/**
 * @module: 
 * Create a custom checkout pane for Drupal Commerce.
 */

/**
 * Implements hook_commerce_checkout_pane_info()
 */
function MY_MODULE_pane_commerce_checkout_pane_info() {
  $panes = array();
  // Custom checkout pane.
  $panes['CUSTOM_MODULE_PANE_NAME'] = array(
    'title' =--> t('Shipping service'),
    'page' => 'shipping',
    'weight' => 11,
    'base' => 'CUSTOM_MODULE_PANE_NAME_pane',
    'fieldset' => TRUE,
  );
  return $panes;
}

/**
 * Implements base_settings_form().
 */
function CUSTOM_MODULE_PANE_NAME_pane_settings_form($checkout_pane) {
  $form = array();

  return $form;
}

/**
 * Implements base_checkout_form()
 */
function CUSTOM_MODULE_PANE_NAME_pane_checkout_form($form, $form_state, $checkout_pane, $order) {

  $checkout_form = array();

  $checkout_form['CUSTOM_MODULE_PANE_NAME'] = array(
    '#markup' => t('Enter custom markup or create a form if needed.'),
  );

  return $checkout_form;
}

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.