Great module! Just what I was looking for!

One problem - the user is not being redirected back to checkout after they create their user account. Instead they are redirected to the home page.

Any ideas?

Comments

guillaumev’s picture

Status: Active » Postponed (maintainer needs more info)

What kind of account creation are you using ? Do you verify the user's email address or not ?

mgladding’s picture

The user is creating a default log in account without email verification.

guillaumev’s picture

Status: Postponed (maintainer needs more info) » Active
mgladding’s picture

Could you let me know what additional info you need?

guillaumev’s picture

I have enough info, thanks... :-)

Now it's just a matter of finding the time to work on this...

mgladding’s picture

Thanks! As a designer, not a developer, I really appreciate all the hard work of the awesome Drupal module developers! Keep up the good work!

dabblela’s picture

Instead of messing with the session, why not just append a destination in your drupal_goto call:

/**
 * Implements hook_commerce_checkout_router()
 */
function commerce_checkout_redirect_commerce_checkout_router($order, $checkout_page) {
  global $user;
  
  if (!$user->uid) {
    drupal_set_message(t('You need to login or create a new account in order to validate your order'), 'status');
    drupal_goto('checkout/'.$order->order_id.'/user/register', array('query' => array('destination' => 'checkout')));
  }
}
valante’s picture

@manatwo, your solution works perfectly if the user decides to register. If he logs in instead, the extra click on the "log in" tab loses the redirection fragment in the URL.

guillaumev’s picture

Status: Active » Needs review

@manatwo Also note that this solution will not work in case an email is sent out to the user to verify his email address. This is why I used the session instead of the destination parameter.

Concerning this issue, it should be fixed with this commit:
http://drupalcode.org/project/commerce_checkout_redirect.git/commit/4e8f29d

Please test it and, if it works for you, change the issue to "reviewed & tested by the community". Thanks !

Anonymous’s picture

I'm redirected to the checkout page but the session is not working - I suppose. Because users don't have the right to access the checkout page and the checkout button from the cart is no longer shown to users. Thank you!

theo_’s picture

The problem is that user is not redirected when user email verification is enabled.

Here is my though, when have a user email verification is required redirect user to the checkout login form otherwise continue the checkout process.

anjjriit’s picture

Category: bug » support
Status: Needs review » Needs work

Thanks a lot for your patch.
It's run well on my site.

Now i need one more functionality to redirect to "checkout/%/user/register/no-email" path.
i have add an menu item below

  $items['checkout/%/user/register/no-email'] = array(
    'title' => 'Create new account without an email',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('user_register_form'),
    'access callback' => 'user_register_access',
    'type' => MENU_LOCAL_TASK,
  );

I have modified my registered form also, use

function mymodule_form_alter(&$form, $form_state, $form_id) {
	switch ($form_id) {
		case 'user_register_form':
			if (arg(0) == 'checkout' && arg(2) == 'user' && arg(3) == 'register' && arg(4) == 'no-email') {
			//....
			}
    	break;
	}
}

my problem is, what the function that i have to modified so i can redirect to path above ?
Any help will be very appreciated.

vasike’s picture

the patch from #11 was included in the patch from #1677106-5: Add user password recovery support..
it seems there's conflict applying both patches and both are needed for Commerce Kickstart.

bojanz’s picture

Status: Needs work » Fixed

Committed.

nelslynn’s picture

Confused as to what is committed. With latest Dev version dated Dec 19, the user is directed to home page after registering for a new account, NOT to checkout page as is the functionality when a current user logs in.

However when I enable Commerce Kickstart Checkout Redirect, the user is directed to checkout after registering for an account. Are both modules required for this or is the goal to have this functionality with only one module required?

Status: Fixed » Closed (fixed)

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

netzkombuese’s picture

This isn`t fixed yet? Can`t get this to work. When activating Checkout Redirect and Commerce Kickstart Redirect the notification Mail for registration is send twice times system message also shows up twice. Without the Commerce Kickstart Redirect Module activated I´m not redirected as nelslynn said. Need Help!

oystercrackher’s picture

Version: 7.x-1.x-dev » 7.x-2.0-beta1
Issue summary: View changes
Status: Closed (fixed) » Active

Reactivating this.

Upon new account creation with required email verification; user is directed to home page upon logging in not to checkout.

Please advise.

Thanks

plach’s picture

Version: 7.x-2.0-beta1 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new793 bytes

The attached patch allows to perfom the redirect after the user has used the one time login and saved its password.

plach’s picture

Version: 7.x-1.x-dev » 7.x-2.0-beta1

Oops, wrong version (actually the patch is rolled against the 2.x-dev branch).

rphillipsfeynman’s picture

There is a little bit of confusion here on what patch to apply. Moreover, I think the downloaded file commerce_checkout_redirect.module for the release 7.x-2.0-beta1 is not complete. It is missing many functions mentioned here. Anyway, I confirm that by applying patch #19 everything works now for me.

synergy99’s picture

To clear up the confusion over which patch to apply, it's plach's

commerce_checkout_redirect-verify_email-1275330-19.patch

against 7.x-2.0-beta1. And use git to apply it.

vasike’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
vasike’s picture

Category: Support request » Task
Status: Needs review » Fixed

There is the commit for the @plach solution (#19 patch) : http://drupalcode.org/project/commerce_checkout_redirect.git/commit/552d84f

so think we can close this issue.

roball’s picture

Status: Fixed » Needs work

I have updated Commerce Checkout Redirect to 7.x-2.0-beta1+7-dev (2014-Feb-28) but still no redirection takes place after having logged in or registered.

In dblog, the following PHP notice is logged after having logged in:

 Undefined index: #order in commerce_checkout_redirect_redirect_anonymous_submit() (line 196 of /etc/drupal7/all/modules/commerce_checkout_redirect/commerce_checkout_redirect.module).
roball’s picture

Title: Not being redirected to cart after account creation » Not being redirected to cart after having logged in or registered
Priority: Normal » Major
roball’s picture

Status: Needs work » Needs review
StatusFileSize
new1.34 KB

The attached patch fixes the problem. It was introduced by commit 859506 in attempting to fix #1688400: Allow registration to be optional.

roball’s picture

The #27 patch works for existing users that login. They will be redirected to their cart after having logged in.

However, it does still not work for new users. They will NOT be redirected to their cart after having registered. Using $GLOBALS['user']->uid instead of $form_state['uid'] for getting the user's UID avoids spitting a PHP notice on registering, so that should be better used, but it still doesn't redirect.

roball’s picture

Title: Not being redirected to cart after having logged in or registered » Not being redirected to cart after having logged
StatusFileSize
new1.33 KB

New patch as per comment #28. I think for the redirection problem on new registrations it would be easier to open an own issue.

roball’s picture

Title: Not being redirected to cart after having logged » Not being redirected to cart after having logged in
vasike’s picture

Status: Needs review » Reviewed & tested by the community

indeed. it seems the issue takes place in Commerce Kickstart, but not in a clean Drupal Commerce.

The latest patch (#29) has the solution (which i removed within previous commit).
So RTBC.

  • Commit e05257b on 7.x-2.x authored by roball, committed by vasike:
    Issue #1275330 by roball, vasike: Revert checkout redirection solution...
vasike’s picture

Status: Reviewed & tested by the community » Fixed

#29 solution commited.
@roball: thank you Sir

roball’s picture

Thank you very much vasike for committing! Now the most important feature of this module is working again in the latest 7.x-2.x-dev. FYI, I do not use Kickstart. The problem happened in a clean Drupal core installation.

Status: Fixed » Closed (fixed)

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

roball’s picture

Title: Not being redirected to cart after having logged in » Not being redirected to checkout after having logged in