How to Create Account at Checkout WooCommerce

WooCommerce Create Account at Checkout

Do you want a quick solution to allow customers in your WooCommerce store to create an account at the checkout page?

If yes, you are in the right place. In this tutorial, I will share how you can add a registration form on the checkout page for visitors.

WooCommerce Create Account at Checkout

There are several reasons why you may want customers to create an account on the checkout page. Some of them include:

  • It is easier for customers to manage their orders and get support.
  • It is for the customer to purchase again (all their details are saved).
  • It is easier for the store manager to track the lifetime value of customers.

However, you should keep in mind that first-time customers’ checkout process should still be as seamless as possible.

WooCommerce has built-in functionality for this, allowing first-time visitors to create a new account automatically.

Steps to Create an Account at the WooCommerce Checkout Page

Here are the steps that you need to follow:

  1. Log into your WordPress site and access the dashboard as the admin user
  2. Navigate to WooCommerce > Settings.
  3. Click on the Accounts & Privacy tab.create account at the checkout page
  4. Check the following options:
  • Allow customers to create an account during checkout.
  • When creating an account, automatically generate a username from the customer’s email address.
  • When creating an account, automatically generate an account password.

When new customer checks out from your site, they will be sent a welcome email with their new account login information.

Tweaking the Email

This template generates the new account email text. By default, the email sends new customers a generated username to log into their accounts.

However, users have been able to log in with their email addresses since WordPress 4.5.

Instead, I send an email that informs the customer they can log in with their email using the following code snippet:

<?php

/**

 * Customer new account email

 *

 * This template has been overriden to change account creation text.

 *

 * @see                                   https://docs.woocommerce.com/document/template-structure/

*/

if ( ! defined( 'ABSPATH' ) ) {

            exit; // Exit if accessed directly

}

?>

<?php do_action( 'woocommerce_email_header', $email_heading, $email ); ?>

            <p><?php printf( __( 'An account has been created for you on %1$s.', 'woocommerce' ), esc_html( $blogname ) ); ?></p>

            <p><?php printf( __( 'You can log in with your email address: %1$s', 'woocommerce' ), '<strong>' . esc_html( $email->user_email ) . '</strong>' ); ?></p>

<?php if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated ) : ?>

            <p><?php printf( __( 'Your password has been automatically generated: %s', 'woocommerce' ), '<strong>' . esc_html( $user_pass ) . '</strong>' ); ?></p>

<?php endif; ?>

            <p><?php printf( __( 'You can access your account area to view your orders and change your password here: %s.', 'woocommerce' ), make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); ?></p>

<?php do_action( 'woocommerce_email_footer', $email );

This code sends new WooCommerce customers an account email with their email address as a login rather than a username.

If you’re not interested in editing code on your site, you could also use a plugin like Email Customizer for WooCommerce to make the modifications.

Conclusion

In summary, you have learned how to create an account at the checkout page using the WooCommerce built-in options.

Additionally, I have shared a custom template code snippet that sends new WooCommerce customers an account email with their email address as a login rather than a username.  If you are not familiar with editing code, please contact a qualified WordPress developer so that you do not break down your site.

Similar Articles

  1. How to Add WooCommerce Checkout Email Validation