Make guest checkout account creation description react to checkout flow configuration

Created on 2 August 2023, over 1 year ago
Updated 29 June 2024, 6 months ago

When "Guest Checkout" is enabled, an anonymous end user will see "Proceed to checkout. You can optionally create an account at the end.". The word "optionally" here, however, seems useless, in multiple ways. Either the description needs to be dynamically updated based on admin configuration, or it needs to be removed entirely.

  • If the admin has enabled "Create a new account for an anonymous order", then the account WILL be created, whether the user wants it to be or not. There is nothing optional about it.
  • If the admin has enabled "Assign an anonymous order to a pre-existing user", then the user won't have the ability to themselves choose whether to optionally create an account or not. The matching is gonna happen whether the user wants to or not.
πŸ“Œ Task
Status

Active

Version

2.0

Component

User experience

Created by

πŸ‡ΊπŸ‡ΈUnited States morbus iff

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @morbus iff
  • πŸ‡ΊπŸ‡ΈUnited States morbus iff
  • πŸ‡³πŸ‡¬Nigeria chike Nigeria

    I too am wondering what is 'optional' about an account that will surely be created without the user doing anything about it.

    I have been searching through the variables on the form and don't seem to see a way to override the text. Is there a way please? I want to set "Proceed to checkout, an account will be created for you at the end. You will be notified via email about your new account."

  • πŸ‡³πŸ‡¬Nigeria chike Nigeria

    For anyone else looking to override this text, you can put this on a custom module or .theme file,

    /**
     * Implements hook_form_alter().
     */
    
    function custommodule_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
              //Override 'Proceed as guest' text
              $form['login']['guest']['text']['#markup'] = t('<p>Proceed to checkout, an account will be created for you at the end. You will be notified via email about your new account.</p><p>You can also proceed as guest if you have an existing account and your new order will be added to your account.</p>');
    }
    
  • πŸ‡ΊπŸ‡ΈUnited States rszrama

    Yeah, the text could be made more dynamic. By default, without auto user creation, you'd use the "pick a password" style form to create an account upon checkout completion, so it makes sense for the default configuration.

Production build 0.71.5 2024