Skip to content
Log in

Collect company details at checkout

On this page

For B2B transactions, it’s useful to capture the customer’s company name during checkout. Use this process to add a company name field to your checkout, and optionally make it required and relabel it.

When the field is enabled, an account is created during checkout based on the company name (or the customer’s first and last name if no company is given). The customer can later update the company name, which updates only the account’s Display Name field.

Enable the company name field

The field is turned on with a Store Variable:

  1. Open the Store record you want to allow a company name on.
  2. In the Store Variables related list, create a new Store Variable.
  3. Give it a Name, such as Enable Company Name.
  4. Set the Key to enable_company_name.
  5. Set the Value to true.
  6. Switch on Available in Liquid.
  7. Click Save.

    Store Variable record with the enable_company_name key set to true and Available in Liquid enabled

The company name field now appears at checkout:

Checkout form showing the company name field

Make the company name required

If the field is left blank, it is filled automatically with the customer’s full name. To force customers to enter a business name instead, add a small script to your store’s head content:

  1. From your Store record, find the Head Content field. Make sure you are using Head Content, not Header Content.
  2. If a content block is already linked, open it and skip to step 4. If there is no link, edit the field and select New Content Block.
  3. Select the No Added Styling template and give the block a name such as Head Content.
  4. Add the following to the Content field:

``` {%- if current_request.path == ‘/checkout/customer_information’ %}

        document.addEventListener('DOMContentLoaded', ()=> {
        const nameField = document.querySelector('#checkout_customer_information_form_company_name');
        nameField.setAttribute('required', 'required');
        });

{%- endif %}
```
  1. Click Save.

Change the field label

To relabel the company name field (for example to “Business Name”), use a Theme Locale translation:

  1. From the Store record, find the Theme field.
  2. If a theme is already linked, open it and skip to step 4. If there is no link, edit the field and select New Theme, then give the theme a name such as My Theme.
  3. Open the theme’s Theme Locales related list, and open a Locale record (or create one if none exist).
  4. In the locale’s related list, create a Locale Translation.
  5. In the Key field, enter checkout.customer_information.form.company_name.
  6. In the Value field, enter the label you want, such as Business Name.
  7. Click Save.

Confirm it is working

Open your store’s checkout and confirm the company name field appears with the label you set. If you added the script, confirm the field is required: try to continue without entering a company name, and check that checkout stops you.

Was this article helpful?

Was this article helpful?