How to create a hybrid B2C/B2B online store with WooCommerce B2B

Guides
How to create a hybrid B2C/B2B online store with WooCommerce B2B

Saturday, 08 June 2024

Target
In this article, we will walk you step by step in setting up a hybrid B2C/B2B online store using WooCommerce B2B. You will discover how to manage B2C and B2B customers efficiently, offering them personalized shopping experiences and optimizing your sales.

Intro
This is one of the most common scenarios, in which the shop is open to both retail sales to private customers (B2C) and wholesale sales to companies (B2B).
The two types of users have different sales processes: B2B customers will probably have more advantageous prices and purchasing methods, but before they can purchase using these methods you want to check if they are actually a real B2B customer and not someone pretending to be for such.
For this purpose, it is a good idea to enable account moderation, but only for B2B customers, as the B2C purchasing process must proceed quickly and easily, without any hitches or impediments.
To have enough data to carry out your checks, however, it is a good idea for the user to enter more information, for example providing their complete billing address including VAT number.

Let’s summarize the specifics of the scenario:

  • B2C/B2B hybrid shop: in your shop you have both B2C and B2B customers
  • Differentiated registration fields: B2C customers register by providing only their email address, while B2B customers also provide their complete billing address, including VAT number
  • B2B account moderation: newly registered B2B customers must wait for their account to be verified before they can log in and purchase

Step 1: groups creation

By default, WooCommerce B2B creates a special group called GUEST that categorizes all logged in, unregistered users without a specific group assigned. We could therefore consider the GUEST group as B2C.
Warning: you can rename the GUEST group as you like, but do not delete it or change its logical use, i.e. always consider that it refers to the types of customers listed previously.

You can create groups in:

 Users -> All groups -> Add new

Rename (for clarity) the GUEST group to “B2C Customers”.
Create a new group calling it (for example) “B2B Customers”.

How to create a hybrid B2C/B2B online store with WooCommerce B2B

Step 2: General settings

We want a customer who registers through the default WooCommerce registration form (generally on the “My account” page) to be considered B2C. To do this, simply go to:

 WooCommerce -> Settings -> B2B

and choose the value “B2C Customers” in the dropdown of the “Default group” option.

We have communicated to WooCommerce B2B that, for now, every customer who registers must be associated with the “B2C Customers” group.

How to create a hybrid B2C:B2B online store with WooCommerce B2B - Group list

Step 3: Registration forms and pages diversification

Currently, we have only one registration form, the default one on the “My account” page, which we have associated with the “B2C Customers” group.
Now we need to create a new one, to be associated with the “B2B Customers” group. Let’s start by creating a new page in WordPress:

 Pages -> Add new page

and let’s title it, for example, “B2B Registration” and insert the shortcode:

[wcb2bloginform wcb2b_group="135"]

assuming “135” is the “B2B Customers” group ID.

How to create a hybrid B2C:B2B online store with WooCommerce B2B - Page

You can find the “B2B Customers” group ID:

  • On the group list page

    How to create a hybrid B2C:B2B online store with WooCommerce B2B - Group list ID
  • In the URL of the group editing page

    How to create a hybrid B2C:B2B online store with WooCommerce B2B - Group ID

    Tip: In the example image, take a look to the URL “https://woocommerce-b2b.com/wp-admin/post.php?post=135&action=edit”.

You can find the shortcode relating to each group, already filled in, on the group editing page, in the “Shortcodes summary” section, near “B2B login/registration forms”.

How to create a hybrid B2C:B2B online store with WooCommerce B2B - Shortcode

By reaching the “B2B Registration” page from the frontend you will see a registration and login form.

At this point, we have that when a customer registers:

  • Through the “My account” page, you will be added to the “B2C Customers” group
  • Through the “B2B Registration” page, you will be added to the “B2B Customers” group

Step 4: Groups configuration

You can set up a single group in:

 Users -> All groups -> Edit (on group you want to configure)
How to create a hybrid B2C:B2B online store with WooCommerce B2B - Group list ID

Unless there are specific needs (which we have not considered for simplicity in this scenario), we do not have any particular configuration to carry out for the “B2C Customers” group.

For the “B2B Customers” group, however, we have two important specifications.

Differentiated registration fields
We want that for B2B customers, in the registration form the customer must also provide the complete billing address including VAT number to register. You need this to verify the authenticity of your B2B customer.

Enable and configure the options:

Extend registration fields
VAT Number

How to create a hybrid B2C:B2B online store with WooCommerce B2B - Options

Tip: In VAT Number option you can choose between “Optional” or “Required”, both display the field in the group-specific registration form, the only difference is the obligatory nature of the field itself.

Once configured, you will see that on the “B2B Registration” page, in the registration form, the billing address fields and an additional field for the VAT number have appeared.

How to create a hybrid B2C:B2B online store with WooCommerce B2B - Form

B2B account moderation
We want that when a B2B customer registers, his account is considered temporarily suspended until the site admin verifies its veracity and decides to enable him to purchase.

Enable the option:

Moderate registration

How to create a hybrid B2C:B2B online store with WooCommerce B2B - Options

When a customer registers, they don’t autolog in (which WooCommerce does by default), but the message “Your account is under review now. You will receive an email as soon as it is activated.”

How to create a hybrid B2C:B2B online store with WooCommerce B2B - Notice

The admin will see the status of an account in the WordPress customer list table, can then proceed to review the account and decide to enable it from the customer edit page.
If enabled, the customer will receive an email notifying the activation of their account and the ability to purchase.

How to create a hybrid B2C:B2B online store with WooCommerce B2B - Status
WARNING! Before making any changes, make sure you have made a complete backup of site files and database.
It is advisable not to edit the theme files directly, but to use a child theme.
For more information on child themes, please read: WordPress Official guide on Child Themes