Is there any way to bypass the customer login and go striaght to checkout when user is already logged into the site?

Doesn't seem very logical to show a blank customer login pane during checkout when user is already logged into the site.

Thanks,

Comments

OpenVenture1’s picture

Issue summary: View changes
OpenVenture1’s picture

Issue summary: View changes
OpenVenture1’s picture

Ok, found a solution.

Quick fix:

/**
* Implements hook_commerce_checkout_router().
* Skip login page for logged-in user.
*/
function overrides_commerce_checkout_router($order, $checkout_page) {
global $user;

if ($user->uid > 0 && $checkout_page['page_id'] == 'login') {
commerce_order_status_update($order,'checkout_checkout');
drupal_goto('checkout/' . $order->order_id . '/checkout');
}
}

OpenVenture1’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

Rosenstrauch’s picture

this should be integrated into the module as default behaviour or config option.

jnicola’s picture

Priority: Normal » Major
Status: Closed (fixed) » Needs review
StatusFileSize
new757 bytes

Re-opening. This isn't a closed issue until it's been brought into the module!

Redoing the code submitted as a patch. and attaching.

jnicola’s picture

StatusFileSize
new767 bytes

Adding new patch. Previous patch must have been in a custom module called "overrides". This new patch renames the hook to properly work with commerce_login_step

jnicola’s picture

StatusFileSize
new767 bytes

Updating commit to properly attribute to organization and client. Was unaware of this ability!

anybody’s picture

#3 works great!

Rosenstrauch’s picture

Status: Needs review » Reviewed & tested by the community

patch in #9 works great.

Rosenstrauch’s picture

the only thing that's troubling is that this leaves us with a "go back" link that doesn't work and an item in checkout progress (possibly linked) which should also be hidden.

Rosenstrauch’s picture

Status: Reviewed & tested by the community » Needs work

also i still maintain this should be configurable as an option in the modules settings (checkbox at admin/commerce/config/checkout/form/pane/account) since some people might prefer the original behaviour.
https://www.drupal.org/node/2362777#comment-9677293

rory downes’s picture

I actually solved this one by simply moving the 'Account information' pane to the 'Checkout' page. Thus when you are logged in it does not appear.
Hope this helps someone else, at least until this is solved in code.
Rory

m-webtechnik’s picture

problem mentioned in #12 is solved with this patch