1

I am using Drupal Commerce Kickstart and since we are having only one payment method I would like to disable the extra step "Payment" in the checkout process which is reserved for "Off-site payment redirect".

I did not find a way to disable this directly in the UI at Checkout settings (admin/commerce/config/checkout) because this checkout pane seems to be locked.

So I digged in code and found line 309 to 315 in commerce_payment.module (profiles\commerce_kickstart\modules\contrib\commerce\modules\payment\commerce_payment.module).

  $checkout_panes['commerce_payment_redirect'] = array(
'title' => t('Off-site payment redirect'),
'page' => 'payment',
'locked' => TRUE,
'file' => 'includes/commerce_payment.checkout_pane.inc',
'base' => 'commerce_payment_redirect_pane',
 );

If I completely remove these lines the payment step is gone. If I set the locked value to "FALSE" I can disable the pane at Checkout settings.

What is the cause that this step is locked and is it safe to disable this step this way?

1

You don't need to disable it, because it will automatically skip itself if the payment method does not require an off-site redirect.

0

Thanks for your help, I understand that the step will be skipped if not necessary.

But I don't like that this additional button "Payment" is shown in checkout process also this will never be needed (in my case). I am assuming that this may confuse some customer to be expecting one more step that is not needed and also customer might think he still has one step before finally sending the order although the order will be placed already when finishing the "Review" step.

I have already succeeded to disable this step by using hook_commerce_checkout_pane_info_alter in a custom module and setting this pane to not be locked and then disabling the pane via checkout settings.

Just wanted to know if this is the way to go and if there are any caveats by disabling this pane.

0

We had slightly different needs in our website, and finaly took the following approach:

  1. First we disabled the review page. so the process is: cart->checkout->payment->complete.
  2. The payment is our custom payment method. With rules we added custom condition: check if the order balance is more than zero: then enable the payment method.
  3. In the configuration of Payment checkout page(admin/commerce/config/checkout/form/pane/commerce_payment) there is an option Require a payment method at all times we unchecked this box and chose the final option: Display a message ... and trigger...

Now for your case:

I think you should explore the options in the checkout settings and disable the panes you do not need. Next look at the various rules you currently have, specially the ones triggered by Completing the checkout process (we override the default to change the status to complete since we had digital products).

Keep in mind that most of the job is happening in the checkout router. (I think that any website in production should implement the hook_commerce_checkout_router )

When talking about payments there is two functions in commerce_payment module that responsible for the redirections and the process flow:

  1. commerce_payment_redirect_pane_previous_page
  2. commerce_payment_redirect_pane_next_page

So if payment is successful, we move forward (each page has next_page definition). and if not, move back. When hitting complete page, all the rules will fire.

Best of luck!

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.