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.
#2857157: Implement registration after guest checkout is adding the guest registration pane for checkout completion page so as per #2907605: Commerce 2 Login checkout pane it would also be nice to have an email_registration compatible pane for this available too.
Remaining tasks
- Test/Review
- Wait for #2857157: Implement registration after guest checkout
Comment | File | Size | Author |
---|---|---|---|
#17 | 2987060-17.patch | 1.75 KB | Sut3kh |
| |||
#7 | interdiff_4-7.txt | 1.07 KB | Sut3kh |
#7 | commerce-2-completion-registration-checkout-pain-2987060-7.patch | 1.87 KB | Sut3kh |
|
Comments
Comment #2
Sut3kh CreditAttribution: Sut3kh as a volunteer commentedPatch is based on #2857157-91: Implement registration after guest checkout which is hopefully looking to be stable enough to review this now.
Comment #4
Sut3kh CreditAttribution: Sut3kh as a volunteer commentedwhoops, fixed patch
Comment #5
gregglesDo I understand it right:
* #2907605: Commerce 2 Login checkout pane will allow existing users to log in with their email address during checkout.
* This issue will allow a user who is checking out as a guest to register with their email (and not a username)
Thanks for your work on this! Can you perhaps review #2907605: Commerce 2 Login checkout pane as well?
Comment #6
andypostI did commit #2907605: Commerce 2 Login checkout pane
Meanwhile this patch needs a bit of polishing for codestyling
trailing whitespaces
Comment #7
Sut3kh CreditAttribution: Sut3kh as a volunteer commentedThanks @andypost, fixed the whitespace (and the dumb setting in phpstorm that caused it).
@greggles That's correct, it just avoids asking them to enter a username (as per the modifications to the normal user registration form).
Comment #8
jnrfred CreditAttribution: jnrfred as a volunteer and at Acro Commerce commentedTested this patch and it works. I was able to create account with the email provided after checkout.
One thing that was done in this patch #2857157: Implement registration after guest checkout is The text 'You can optionally create an account at the end.' in the login checkout pane is only displayed when the registration pane is enabled so we need to find a way to display same text if email registration pane enabled. Currently, it will only show Proceed to checkout.
Apart from that this patch works.
Comment #9
jnrfred CreditAttribution: jnrfred as a volunteer and at Acro Commerce commentedComment #10
andypostDoes it makes sense to create new issue or could be fixed here?
Comment #11
AnybodyWouldn't it be better to replace / override the form from #2857157: Implement registration after guest checkout or add an option there instead of adding a further checkout pane based on it (by extends)?
I guess that would be easier to understand for users. Does it even make sense to give them the choice which pane to use?
Comment #12
AnybodyI guess we should also test this combined with #3016156: Multiple issues with Commerce 2 login checkout pane?
Comment #13
andypost@Anybody not sure it is duplicate but needs someone using commerce to explain which implementation more useful
Comment #14
MegaChriz CreditAttribution: MegaChriz at WebCoo commented@Anybody, @andypost
#3016156: Multiple issues with Commerce 2 login checkout pane is a different issue: that one is about fixing issues for the login checkout pane, shown at the beginning of the checkout process. This issue is about adding a registration checkout pane, shown at the end of the checkout process.
Looking at the code in this issue, a form alter instead of a new checkout pane looks like that would work as well. Extending an other pane only needs to be done if you need to override other methods from it that cannot easily be overridden by a form alter. I think a good case for extending an other pane is when you need to alter the output of
::buildPaneSummary()
.Comment #15
AnybodyThank you for the clarification, MegaChriz!
So we should decide here, if we need to rewrite the patch and alter the form OR keep the extension logic from #11. What do you both think?
Anway the patch might need some tests so I'll keep this at "Needs work".
Just as a side note, because I think you may often want to hide the user name input entirely when using email address instead: I created an issue at the Real Name module for that, because it doesn't have an integration with the commerce steps yet. Perhaps we should also keep that in mind / update that issue afterwards, because these issues may interfer with the form fields: #3016635: Provide integration with Drupal Commerce checkout registration
Comment #16
bohemier CreditAttribution: bohemier commentedI think the commerce checkout pane should also generate the same username as normal registration. Currently, if someone registers as
thisIsMyEmail@gmail.com
their username endsup beingthisIsMyEmail
. But registering on the commerce pane with the same email address renders the whole email address as username instead.Comment #17
Sut3kh CreditAttribution: Sut3kh as a volunteer commentedI agree it would be better in a form alter so it 'just works' with the standard pane when the module is enabled, as per other forms.
Unfortunately I don't have time to further this at the moment, just thought I would share our re-roll of #7 to the final committed version of #2857157: Implement registration after guest checkout in case anyone else is already using the previous patch.
@bohemier this just replicates the standard email_registration user register form alter. Based on that, it looks like you could should be able to provide your own hook_email_registration_name() to keep the email address as the username.
Comment #18
lkacenjaIt seems like whatever the outcome of this and #3016156: Multiple issues with Commerce 2 login checkout pane they should take the same approach. While I tend to think a form alter based approach has some benefits over two new checkout panes, I think they are pretty far down that path with the login form. Should there be conversation about the way both of these issues are being approached or should we just stick with the checkout pane for registration as well?
Comment #19
andypost@lkacenja that's why 2 issues to get "pro&con" of both... commerce is evolving and drop as well
One day we could get #286401: Make email not required for a Drupal site account commited
Comment #20
greggles@andypost - which do you prefer? Or what do you see as the pros/cons? @lkacenja can work on either solution, but is looking for direction. I don't have a preference.
Comment #21
andypost@greggles Meanwhile I have no projects using this integrations, so prefer to collect opinions from real life
Comment #22
lkacenjaTo update, it sounds like we are moving in the plugin direction. The login form issue should be resolved soon. I will create an issue to address #8 from this thread. Then hopefully, we can get this one rolled out as well!
Comment #23
lkacenjaI realized #8 will need to be a separate issue. The change to the login pane needs to happen after this pane is committed. I reviewed and tested this #17. I was able to register accounts as advertised. It's also consistent with the approach taken on the login pane. There is a very minor style issue with the buildPaneForm signature. I think those parameters should go on the same line. Seems great to me.
Comment #24
gregglesFixing up credit.
Comment #26
gregglesOK, committed and pushed. Thanks for all the code, reviews, discussion and thoughts on this issue.
Comment #27
gregglesFolks interested in this issue may also want to look at #3081857: Login checkout pane should show guest checkout greeting message.