The text in the customer checkout pane presented to anonymous users reads as follows:
"Enter a valid email address for this order or click here to login with an existing account and return to checkout."
This is a lie; the token "!url" is a simple "user/login" link, and does not return the user to the checkout after they have logged in. In order to return the user to the checkout, the link needs a query string of "destination=cart/checkout" - which can be derived using the drupal_get_destination() function. To be precise, the array('!url' => url('user/login')) argument in the t() function should be changed to array('!url' => url('user/login', array('query' => drupal_get_destination()))).
Find attached a patch that .... does ... this thing. Above. Yeah.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 975394.patch | 1.72 KB | tr |
| uc_cart_checkout_pane.inc_.txt | 811 bytes | kingandy |
Comments
Comment #1
tomw commentedThanks for supplying the patch, worked great.
Would be great to get this fix into the next release of ubercart.
Comment #2
tr commentedAttached is the patch as committed.
Comment #3
longwaveReopening, because I think most of this code can be removed as well:
The last three lines handle merging carts when a user logs in (although hook_user also has code for this?) but the first part seems useless now.
Comment #4
longwaveThe patch in #2 also needs porting to 7.x.
Comment #5
longwaveThe code I quoted in #3 dates back to D5! I removed it, and also fixed the use of drupal_get_destination() when forcing users to log in before going to checkout, in both 6.x and 7.x branches.