CheckoutWC starts the checkout with the customer’s email address. If it matches an account, it offers to log them in. If your store lets customers create an account at checkout, it can also create the account for them. These settings are on CheckoutWC » Pages, Checkout tab, under Login and Registration.
When you’d use this
- You’d rather returning customers weren’t prompted to log in.
- You want customers to choose their own password when they create an account.
- You want guest orders linked to the customer’s account.
- You want to change the email or create-account fields with code.
Whether customers can create an account at checkout at all is a WooCommerce setting: WooCommerce » Settings » Accounts & Privacy, Account creation, During checkout.
Login and Registration settings
Disable Automatic Login Modal
When a customer enters an email address that belongs to an account, CheckoutWC opens a login window. Turn this on to stop it opening automatically. Off by default.
Registration
How customers get a password when they create an account at checkout:
- Enhanced (Recommended), the default: the account is created without a password field at checkout, and WooCommerce’s new account email gives the customer a link to set their password.
- WooCommerce Default: the checkout shows a password field and the customer chooses their own password.
User Matching
What happens to guest orders placed with the email address of an existing account:
- Enabled (Recommended): the order is linked to that account, including an order the customer pays for again after a failed payment, and a customer’s earlier guest orders are linked when they create an account.
- WooCommerce Default: guest orders aren’t linked.
Code snippets for account fields
These need a developer. Add them in the PHP Snippets box (CheckoutWC » Advanced, Scripts tab), a code snippets plugin or your child theme’s functions.php.
Show the email field to logged-in customers
CheckoutWC hides the email field from logged-in customers and uses their account email, because changing it at checkout wouldn’t change their account. To show it anyway:
add_filter( 'cfw_hide_email_field_for_logged_in_users', '__return_false' );
Start the create account checkbox cleared
When customers can create an account at checkout, the create account checkbox starts selected. To start it cleared:
add_filter( 'cfw_check_create_account_by_default', '__return_false' );
If a customer changes the checkbox, CheckoutWC remembers their choice for the rest of their visit.
Use the email address as the username
With Registration set to Enhanced (Recommended), WooCommerce makes up a username for new accounts. To use the customer’s email address as their username instead:
add_filter( 'woocommerce_new_customer_data', function ( $data ) {
$data['user_login'] = $data['user_email'];
return $data;
} );
Change the guest link in the login window
The login window has an “Or continue as guest” link under the Login button, so a customer who can’t log in can carry on without an account. To change its wording:
add_filter( 'cfw_login_form_continue_as_guest_button_text', function () {
return "Can't log in? Continue as guest.";
} );
The link only appears when guest checkout is allowed: if WooCommerce requires an account at checkout (WooCommerce » Settings » Accounts & Privacy, “Allow customers to place orders without an account” off), it isn’t shown. The filter was added in CheckoutWC 9.0.34.
To make the link stand out, style it with CSS in Custom CSS on the Design tab of CheckoutWC » Appearance. The link has the ID cfw_login_modal_close and sits inside .cfw-login-modal-navigation, under the Login button. For example, to make it bolder and underlined:
.cfw-login-modal-navigation #cfw_login_modal_close {
font-weight: 600;
text-decoration: underline;
}
Common issues
There’s no create account option at checkout
Turn on During checkout under Account creation on WooCommerce » Settings » Accounts & Privacy.
Customers don’t get the new account email
With Registration set to Enhanced (Recommended), customers set their password from the link in WooCommerce’s new account email. Check that it’s turned on under WooCommerce » Settings » Emails, and that your store’s emails are being delivered.
The login window keeps opening for returning customers
Turn on Disable Automatic Login Modal. Customers can still log in from the “Already have an account with us? Log in.” link on the checkout.