Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | commerce_checkout_redirect-2648084-6.patch | 1.23 KB | ckng |
Comments
Comment #2
GoddamnNoise CreditAttribution: GoddamnNoise at Karakana Factoría TIC commentedHi,
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 thecommerce_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.
Comment #3
AlfTheCat CreditAttribution: AlfTheCat commentedConfirming the same issue.
It makes the module not usable in many cases.
Comment #4
krupa CreditAttribution: krupa commentedI am having the same problem. Do you guys have any solution?
Comment #5
djg_tram CreditAttribution: djg_tram commentedThe solution is in the opening post all right:
Comment #6
ckngSee attached patch.