Closed (won't fix)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Cart
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Aug 2012 at 16:18 UTC
Updated:
21 Aug 2016 at 22:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
GuGuss commentedI'm proposing that patch (worked with theo_) for that.
Comment #2
GuGuss commentedComment #4
rszrama commentedNote that we can't have Cart depend on Checkout and Checkout depend on Cart. You'd never be able to uninstall either one. : )
Comment #5
theo_ commentedIt seem obvious not to have both module cart and checkout which depend on each one another ...
So should we implement this functionality in the cart module ?
Comment #6
rszrama commentedAs written, yes it should be part of the Cart module. That said, I'm not sure the approach is sufficient and may be better off remaining a contributed module. (For example, it appears any Drupal login would be sending the customer to the checkout form, no?)
Comment #7
theo_ commentedOnly if the user have a cart, then yes it would be redirected to the checkout.
Maybe we should set up an additional session variable when an anonymous user try to checkout, then we will be able to redirect only users who wanted to checkout.
Comment #8
theo_ commentedHere is the new patch :
Checkout redirect is attached to the Cart module.
Only users who wanted to checkout while anonymous will be redirected to checkout, according to a session variable.
Comment #10
rszrama commentedRetesting on 7.x-1.x-dev.
Comment #11
theo_ commented#8: 1736850-checkout-redirect-2.patch queued for re-testing.
Comment #12
hazaIn some case here, when the user log in, he got the right uid but the order (and the order also have the correct user_uid) but since we rely on a static variable in commerce_cart_order_id(), it can still have the order with uid = 0.
New patch attached.
Comment #13
hazaOops, just saw that we also miss to check if the session variable exist or not (might throw a notice).
Fix
Comment #14
hazaWe saw, on a project, that the drupal_goto() might be a little to brutal. (skipping some other form submit function that came after that), so, new patch but this time, using a $form_state['redirect'] to redirect the user.
Comment #15
jsacksick commentedI just found a bug in the #14 patch, you were able to checkout by going to checkout/order_id directly, I updated the logic and I implemented a hook_commerce_checkout_redirect(). in the commerce_cart module.
Comment #16
jsacksick commentedNew patch that directly acts on the checkout module instead of the cart module.
This also adds a fieldset called "Checkout settings" where I added the checkout redirection setting.
Here is a screenshot : http://cl.ly/image/0V3X3J3t2O0G
Comment #17
bojanz commented4 years later, it's safe to say this isn't happening. We did do it in 8.x-2.x, though.