Allow anonymous checkout to use Order contact email

Created on 8 June 2023, over 1 year ago
Updated 2 July 2023, over 1 year ago

Problem/Motivation

Most of my customers are registering for family events. Therefore, they're usually registering for themselves and for their spouse / children. Considering this, it makes no sense to ask for an email address for each registrant / space in a single order: the module should allow the use of the more general "Contact details" block email address from the Commerce module.

I tried removing the Email field from the registration form display for the Checkout view mode (admin/structure/registration-types/dinner/edit/form-display/checkout) but this induces an error (WSOD) at the end of the checkout process because these Email fields are used to send the confirmation email (which is something I need).

Proposed resolution

Allow the module to use the general Contact details email address of the order instead of an email address for each registrant in a single order.

The confirmation email should be sent to that email address as well.

This is a follow-up from the discussion we had here: https://www.drupal.org/project/commerce_registration/issues/3347930 ✨ Allow the Spaces (number) field to display during checkout Active

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Checkout

Created by

πŸ‡§πŸ‡ͺBelgium Axael

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

Comments & Activities

  • Issue created by @Axael
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States john.oltman

    Please try the attached patch and let me know if that solves the WSOD. Thanks!

  • πŸ‡§πŸ‡ͺBelgium Axael

    I'll try that out, thanks John!

  • πŸ‡§πŸ‡ͺBelgium Axael

    So, I tested this patch and it actually doesn't solve the whole issue.

    As far as I tested, the order confirmation email is correctly sent to the order contact email, but I still get the WOSD and the following error in the Watchdog:

    InvalidArgumentException: Invalid step ID "" passed to redirectToStep(). in Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowBase->redirectToStep() (line 214 of /var/www/web/modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowBase.php).

  • πŸ‡ΊπŸ‡ΈUnited States john.oltman

    If the email is being sent, then you are past the original issue, and hitting a new problem that appears to be unrelated to commerce registration. Your new issue is with your checkout flow. Review your checkout configuration and any custom code to see where the problem lies. Maybe you need to add a payment or completion step at /admin/commerce/config/checkout-flows/manage/{checkout-flow-id}.

    I'll go ahead and commit the patch since it is solves the original issue.

  • πŸ‡ΊπŸ‡ΈUnited States john.oltman
  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States john.oltman
  • First commit to issue fork.
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024