Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Checkout
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Aug 2018 at 14:18 UTC
Updated:
9 Feb 2021 at 14:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
aaronbaumanHere's a patch which is similar to what I'm running with locally, though in a custom module.
I'm not sure if it makes sense for all use cases to expose this path - maybe there's a configuration switch?
Maybe it's an add-on module?
I don't expect this patch will pass tests or get committed, but offer it as a starting point
Comment #3
mglamanComment #4
anybodyWe're having the same requirement and yes, I think that makes sense and the implementation seems good to me.
Perhaps a Commerce maintainer should have a view?
+1 for RTBC.
Comment #5
john_b commentedThe user is guaranteed to have only one cart if the site is using commerce_combine_checkout module.
@AaronBauman would you share the custom module version, please?
Comment #6
aaronbaumanIn my case, I created a route at "/checkout" with this setup:
example_module.routing.yml:
Controller:
Comment #7
john_b commented@AaronBauman Thanks!
Comment #8
rszrama commentedJust found this issue while trying to see if I should create it or not. : )
Re: the logic in the new controller function, are we sure current() is the right approach? I'm just not clear if the loop leaves the pointer at the end or will reset it to the beginning of the array. (Edit: fwiw, it's the first element.)
As a core feature, to avoid any confusion in the event a customer does legitimately have multiple carts, perhaps we should redirect back to /cart if we find more than one cart with items?
This will need tests before we can commit it.
Comment #9
anybodyThank you for your feedback @rszrama!
Yes I think so and I'd suggest to log a message to watchdog (to inform the shop owner) and show a configurable message to the user?
Comment #10
lukasss commented+1 for this
Comment #11
jsacksick commentedThe attached patch addresses the comments from #8, and adds tests coverage.
Additionally, I made the following changes / improvements:
Comment #12
rszrama commentedI think it's fine not to have a message in the event of multiple carts. In such a scenario, selecting the cart to proceed with should be understood to be the first step in the checkout process. The default verbiage for the status message is fine with me. Worked great in local testing!
Comment #13
anybodyGreat work, thanks a lot @jsacksick! I can also confirm RTBC.
Comment #14
jsacksick commentedCommitted! Thanks for the help with review/testing!