IMO every good shop has checkout progress indication stating your current position within the whole checkout process.

I made it a separate module, but I can provide a patch if it's wanted for Drupal Commerce core?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama’s picture

Haven't had a chance to give this a test drive yet, but it's on my to-do list. This is definitely desired functionality (Bojhan mentions it here as well), I just hadn't bothered trying to implement it yet.

rszrama’s picture

Status: Active » Needs work

So, just checked this out, and it's simple enough. One thought I had on the implementation, though, was what if instead of making the markup part of the form array it was implemented as a block that only appeared on checkout pages? This would make it a little more mobile and provide a simple place to add settings, like to control which pages show up in the progress indicator. For example, on my test install the "Payment" step is being shown, but the Payment page is really only an intermediate page for redirected payment methods and wouldn't necessarily be a part of the checkout process for everyone. On the same note, pages that don't have any checkout pages on them are showing up, too.

Last, I'm not sure what version of Commerce you're working against, but your hook_form_FORM_ID_alter() won't work as is (unless something's changed in D7 HEAD I don't know about) because the form ID for each page in the checkout process is unique. I only got it to show by changing that either to specifically reference a particular page's ID or making it a general hook_form_alter() with a broader check.

PieterDC’s picture

Thanks for the review.

My Drupal 6 version of this has it implemented as a block.
I was just being lazy not doing the same for Drupal 7.
I'll change that.

I also noticed pages without panes still showing up.
Gotta change the module so that you can check (using checkboxes on a settings page) which pages to show (preferably with smart defaults). Visibility settings on the provided block?

I also found it quite peculiar the way my hook_form_FORM_ID_alter() seems to work.
I'm using Drupal 7.0-alpha7 and Commerce 7.x-1.0-alpha1
But it doesn't really matter any more when we use a block instead of a form alter.

Damien Tournoud’s picture

Also, we probably don't want *all pages* to display in the indicator, so it would probably be a good idea to add a $page->display_indicator property to the page definition.

If a page has $page->display_indicator = FALSE, it should not appear in the progress indicator. If the page is still displayed to the user, the indicator should be shown as if the previous page that is displayed in the progress indicator was active.

PieterDC’s picture

Status: Needs work » Needs review
FileSize
3.47 KB

The (attached) new version of this module provides a block.
The page visibility settings form is altered.
You get a checkbox for each checkout page.
So you can easily choose on which pages the block should appear.

1 problem though; this doesn't work for the first checkout page.

We could set the path for that page to 'checkout/*', but then, you can't hide the block on other pages, as they use something like 'checkout/*/review'.
I tried to use 'checkout/.+[^/]' but drupal_match_path() escapes all regex specific characters by applying preg_quote(). Only the asterisk (wildcard sign) gets through.

If you surf to 'checkout/1/checkout' instead of just 'checkout', the module works.
Which piece of code redirects 'checkout' to the same url with your order id appended?
Could we adjust that to allways append the page id?
That would solve the problem for this module.

Something will have to change. But I'm not sure which is the best solution?

PieterDC’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.0-alpha2
FileSize
3.33 KB

The (attached) new version of this module works better than ever, combined with the patch from #942316: Complement the path of the first checkout page with its page id if none given

PieterDC’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev
FileSize
3.45 KB

The (attached) new version of this module doesn't need the aforementioned patch any more.

rszrama’s picture

Component: Checkout » Contributed modules
Status: Needs review » Needs work

This probably needs to be brought up to speed with the latest development after 5 months of inactivity. Additionally, it's probably better served in contrib where it can mature and release faster than core would allow... not every e-commerce site needs a progress tracker after all.

yvesvanlaer’s picture

@PieterDC: Nice effort with the checkout progressbar. It is almost what I was searching for.
There is one slight mistake though: you also should change: t($page->title) to t($page['title']) in commerce_checkout_progress_form_block_admin_configure_alter and theme_commerce_checkout_progress_list. :)

PS, $class = ($page_id == $current_page_id) ? 'active' : ''; in theme_commerce_checkout_progress_list works as well.

latulipeblanche’s picture

FileSize
7.05 KB

This is what I need ... but I get a

Notice : Trying to get property of non-object dans commerce_checkout_progress_form_block_admin_configure_alter() (ligne 47 dans /var/www/pbcosmetics/sites/all/modules/commerce_checkout_progress/commerce_checkout_progress.module).

When I want to tell the block, where to be shown there i a list with checkout's and the name "array" (I added the image).

Are you making a "real" module for this ?

webmasterkai’s picture

Assigned: Unassigned » webmasterkai
Status: Needs work » Closed (won't fix)

Since Ryan has suggested it move to contrib I have created a sandbox and started fixing a few things. I'll promote it to a real project once we get it working with the current version of commerce. Please use the issue queue for any further issues related to commerce_checkout_progress. PieterDC, I've added you as a maintainer so you should have git push access if you want to help out.

Issue Queue: http://drupal.org/project/issues/1291268?categories=All
Project Page: http://drupal.org/sandbox/webmasterkai/1291268

rszrama’s picture

Wow, thanks so much for taking this on, Kai. Good to see you in the queue. : D

PieterDC’s picture

Ok. Thanks.

webmasterkai’s picture

rszrama’s picture

Excellent. Thanks for following up here with it.