0

Drupal 8, Drupal Commerce

We desire a "guest only" checkout experience. We don't want to associate orders or customer profiles with Drupal user accounts.

An unauthenticated user can checkout as a guest and achieve this.

However, if a user is authenticated before they checkout their order and customer profile will be associated with their Drupal user. This is what I am trying to avoid.

Does anyone have pointers for how this might be accomplished?

  • Really unclear what you're asking. You have multiple checkout flows and one among them is guest only? Which is working fine but now when an already registered user wants the guest checkout it's still associating the order with their profile? If so, ensure to trigger a user logout when clicking guest only checkout. – leymannx May 26 '18 at 23:55
1

It sounds like you're trying to work against some basic assumptions of Drupal Commerce, namely that users who are logged in should be associated to their data. This is true of Drupal itself - for example, an authenticated user cannot create an anonymous comment.

The simplest thing to do would be to instruct these users to log out. You can likely find a way to alter how Drupal Commerce creates new shopping cart orders such that authenticated users get anonymous orders associated to their sessions similarly to anonymous users, but I can't guarantee that the module throughout won't be checking to see if the user is currently logged in and making assumptions based on this elsewhere.

  • 1
    Thank Ryan, Thanks for the reply. You are always so helpful! I agree I am fighting a well thought through design. A design I typically appreciate. For this build, I just have this unique scope requirement "Don't save any commerce data". I am going your suggested route, ask/unauthenticated users before they add to their cart. Thanks again! – maestrojed May 29 '18 at 16:13

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.