3

Is it possible to register a user for a Craft user account as part of a Craft Commerce checkout flow? Ideally something where you can ask if the user wants to create an account and save their details as part of the checkout flow. Is this doable? (I'm surprised this isn't somehow in Commerce, given how incredibly prevalent such a UX flow is.)

2

To create an account for a Commerce customer you'd use the exact same method as registering a Craft user via the front-end. The only difference would be that you may already have some of their details. You could use their name and email address to autofill these fields, meaning they'd only need to enter a password.

The code to do this can be found in the docs on the User Registration Form page.

  • Thanks Luke. So you're suggesting adding a password field at some point in the flow to capture a password and do a POST (ajax maybe) to create the actual account? – Mike Feb 14 '17 at 15:43
  • Yep, I add a password field on the order summary page - after a successful payment has been made. It uses ajax to submit and display an error or success message. – Luke Pearce Feb 14 '17 at 15:52
  • Cool - that sounds like just what we need. Thanks! – Mike Feb 14 '17 at 16:35
  • I wrote a plugin that helps with this a bit, you might find it useful: github.com/bossanova808/CommerceRegisterOnCheckout – Jeremy Daalder Feb 15 '17 at 2:12
  • I create the user as the first step in the checkout process (just an email an password). After registration the cart addresses will be automatically updated and saved in the user profile (ATTENTION: you have to add the craft commerce field "customer info" to the user profile). I works like a charm. – outline4 May 31 '17 at 21:00
3

Luke's answer above is absolutely right and the simplest approach, but as I commented above, I wrote a plugin for this:

https://github.com/bossanova808/CommerceRegisterOnCheckout

..the reason being that I wanted to integrate registration during the checkout, not after as Luke has done above. And the motivation for this is that site registration rates plummet (like, by 80%+ in my totally anecdotal data/experience) - if the registration comes AFTER checkout. We get a MUCH higher rate of people joining (which has all sorts of business benefits for us) - if we integrate it right IN to the checkout flow. I can't say why that is precisely, but it seems like most folks mentally check out (excuse the pun) the moment they hit 'Submit Order'....

So I wrote the above to allow a more integrated approach, which does much as what you describe - there's an ajax POST but it's during the payment part of the process (i.e. the actual checkout but), and the user is then registered & logged in (and can e.g. be taken then automatically to their orders summary page). If there is any failure in registration (e.g. they've forgotten they registered before) - we handle that and present whatever we need to (including possibly a pre-filled registration form for them to have another go with).

(BTW I agree - this should definitely be supported by Commerce in core).

  • Great plugin. From a marketing perspective, I would also look at how you're on boarding customers. Why are they not registering? What do they gain? If you have an existing order with their e-mail address, nothing is stopping you from setting up some e-mail marketing automation after they order (but haven't registered) to entice them to "join." "Sign up and receive X off THIS (or next) order; only valid with the next 24 hours!" or whatever. – RitterKnight Feb 15 '17 at 19:29
  • Agreed (although in some countries you might run afoul of unsolicited email laws). But listing out the advantages right over the 'Register' box is a good idea. We find almost everyone registers if you get the flow right, and this makes for much better long term/repeat customer retention. – Jeremy Daalder Feb 15 '17 at 21:31
  • Yeh obviously abide by any applicable laws. I'd find it hard to believe you'd run afoul because the customer already agreed to do business with you. I don't know what it's like in other countries but in the US, you're continuing the transaction by saying "here's the benefits... you may have missed this when signing up." This could even be in your "order confirmation" e-mail. It's really no different than when a company upsells you because it's based on the PRIOR transition. Obviously a grey area of not angering them.. but sometimes a little RELEVANT persistence in the sales process pays off. – RitterKnight Feb 15 '17 at 21:40
  • 1
    Ha yeah I'm probably more paranoid about that than I need to be. But yep equally good to keep an eye on is whether it will have more positive impact than negative (to both balances and customer happiness!). I find this a tough line to tread! – Jeremy Daalder Feb 15 '17 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.