Hi,
if it's enabled the email verification, when the new user accesses to the site from the email link to insert his own password, then he is not redirected to the checkout page.
I've found that the condition if ($order = commerce_cart_order_load()) in commerce_checkout_redirect.module, line 183, necessary to append the checkout redirect function on user's forms, returns false when the user is logged in, as in the case he has clicked the link in the validation email.
If I instead insert the $user->uid as parameter in commerce_cart_order_load(), then the redirect works.

CommentFileSizeAuthor
#6 commerce_checkout_redirect-2648084-6.patch1.23 KBckng
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alez.k created an issue. See original summary.

GoddamnNoise’s picture

Hi,

I'm facing the same bug using the 7.x-2.0 version of the Checkout Redirect module.

When the user clicks on the link received by e-mail, the form to update the password is shown to the user, which is the right thing to do at that moment, but after that, the user should be redirected to the checkout process, but that doesn't happen.

As alez.k states, the problem is in the commerce_checkout_redirect_form_alter function, in the if ($order = commerce_cart_order_load()) { sentence (which is the 187th line of the commerce_checkout_redirect.module in the current 7.x-2.x version). When the user updates the password in the form after receiving the link by e-mail, the cart is no longer linked to the anonymous user, so it can't be retrieved by calling the commerce_cart_order_load() without parameters and should be called passing the $user->uid as a parameter.

IMHO, this is scenario where Drupal Core's "Require e-mail verification when a visitor creates an account." option is checked is pretty common, because the store owner usually wants to have a valid e-mail address for any user who makes a purchase on the web store. So, fixing this bug seems pretty important to me, but this thread is one year old and it has no answers. Maybe I could help fix it with some advice from the module creators/mantainers, who have much more knowledge about the topic than I've.

AlfTheCat’s picture

Confirming the same issue.

It makes the module not usable in many cases.

krupa’s picture

I am having the same problem. Do you guys have any solution?

djg_tram’s picture

The solution is in the opening post all right:

global $user;
if ($order = commerce_cart_order_load($user->uid)) {
ckng’s picture

Version: 7.x-2.0-rc1 » 7.x-2.0
Status: Active » Needs review
FileSize
1.23 KB

See attached patch.