1

is there a way to have a separate page for payment method selection, to allow clients to select the payment method they want to use instead of the current way drupal commerce use (integrating payment selection in the review order page)?

Thanks in advance for your support.

3

Sure! You can use a module like Commerce Checkout Pages to create a new page via the UI or you could implement hook_commerce_checkout_page_info() in your module and create a new page. Then just move your Payment pane onto your new page and you'll be all set:

/**
 * Implements hook_commerce_checkout_page_info().
 */
function MYMODULE_commerce_checkout_page_info() {
  $checkout_pages = array();

  $checkout_pages['payment'] = array(
    'name' => t('Payment'),
    'title' => t('Payment'),
    'weight' => 3,
  );

  return $checkout_pages;
}

Then, implement hook_commerce_checkout_pane_info_alter() to add your payment pane to your new page:

/**
 * Implements hook_commerce_checkout_pane_info_alter().
 */
function MYMODULE_commerce_checkout_pane_info_alter(&$checkout_panes) {
  // Payment selection on the new 'payment' page.
  $checkout_panes['commerce_payment']['page'] = 'payment';
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.