If you disable the panes programmatically then any blank pages in the checkout process are still shown. The panes are disabled in the following way per a custom module that is used to make conditional panes. This is done the same way as my tutorial / thread in Commerce Examples: Conditional Panes Example

<?php
    $panes_additional_service = array(
             "account",
             "cart_contents",
             "checkout_completion_message",
             "checkout_review",
             "commerce_coupon",
             "commerce_payment",
             "commerce_payment_redirect",
             "continue_pane",
             "customer_profile_billing",
             "extra_pane__node__103",
             "login_pane",
             "rules_pane");

    foreach($checkout_panes as $pane_name => &$pane_data) {

                            // Override all other panes to make them disabled.  
                            if (!in_array($pane_name, $panes_additional_service, true) && $pane_data['enabled']) {

               		      // the pane is enabled by default, so we need to disable it
              		      $pane_data['enabled'] = 0;
             		    } 
             }
?>
CommentFileSizeAuthor
#1 1846988-1.checkout_page_next_prev.patch1.36 KBrszrama
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
1.36 KB

Give this patch a try.

JMOmandown’s picture

Status: Needs review » Reviewed & tested by the community

Patch works like a charm!

dpolant’s picture

I concur that patch works. Somebody want to bring it in?

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1846988-1.checkout_page_next_prev.patch, failed testing.

rszrama’s picture

Status: Needs work » Needs review
dpolant’s picture

Noticed one problem .. this doesn't help when the page you are trying to make it skip is the first page. Also, it would be nice if there were a way to actually alter the list of active checkout pages so that modules like checkout progress can display an accurate list. I can see that being kind of tricky though .. for instance it didn't like it when I just tried unsetting pages from the info array.

A workaround for the first-page problem is to put some logic in a hook checkout router and force a redirect. Works for me because in my case I know what panes are going to be on the first page but would be more complicated if one didn't know this.

JMOmandown’s picture

Another option, although dirty, may be to simply call the hook or function from the redirect to cart rule, so that it always fires prior to the first page. Just a thought. But I agree that while it may be nice I would assume that would require quite a bit a restructuring based on my limited knowledge of the checkout module.

Another dirty workout would be to have the first page be simply a blank page with a redirect fired upon accessing it, essentially making all content pages second or later.

rszrama’s picture

Status: Needs review » Fixed

I'm going to go ahead and commit #1 as is, as it definitely represents a bug in the current logic. Questions about how to alter checkout pages in general / bypass the first step will likely just have to be solved on 2.x. I'm not entirely sure of the way forward, but we definitely need to support dynamic checkout "paths" as opposed to just a single path for every order. Right now you could do something like a hook_commerce_checkout_page_info_alter() and fiddle with weights and such if you wanted based perhaps on the URL, but there's still gonna be that tricky redirect you'll have to overcome from /checkout to /checkout/[order-id]/[checkout-page].

If someone gets anywhere with that, please open a postponed feature request and link it in from #1467180: Open 2.x Drupal Commerce branch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.