Company accounts
A company is the account a group of customers (the members) act for.
How companies are created
A company gets created in three ways.
1. Automatic provisioning on registration
When a new customer registers with a company name, B2B+ Base automatically creates a company and makes the customer its owner.
- The company name is taken first from the account-level "Company" field; if empty, the company name of the default billing address is used.
- If the customer enters no company name, no company is created.
- If the customer is already a member of any company, nothing is created (provisioning is idempotent).
INFO
Provisioning runs in the background on the registration event. If it fails, registration is never blocked — the error is only logged.
2. Invitation (for later members)
Additional people are not added via a new company, but through an invitation into an existing company. See Invitations.
3. Backfill for existing customers (console command)
Customers who registered with a company name before the plugin was installed (or who were imported) do not have a company yet. A re-runnable console command handles this:
bin/console avellon:b2b:backfill-companiesThe command walks through all customers with a non-empty company name that are not yet a member of any company and, for each, creates:
- a company (name = the customer's company name),
- an owner membership,
- and copies the customer's address book into the company addresses (carrying over the default billing/shipping flags from the customer's own defaults).
Safe to re-run
The command is idempotent: customers who already have a membership are skipped, so a second run changes nothing. A summary is printed at the end (companies created, addresses copied, customers skipped).
Company data
A company carries the following master data:
| Field | Description | Required |
|---|---|---|
| Company name | The name of the company account. | Yes |
| VAT ID | VAT identification number. | No |
| Registration number | The company's registration number. | No |
| Active | Controls whether the company can be used. An inactive company cannot be selected as the active company. | – |
Members see the company data and their own role in the storefront under Account → Company account → Company ("My company" page).
Admin module (read-only)
Under Customers → Companies the Administration lists all companies and shows each company's members. Creating/editing happens in the storefront account area (owners/admins) or via the Admin API. See Configuration.
Active company & company switcher
A customer can be a member of several companies. At any moment, however, they act for exactly one — the active company.
- The active company is remembered in the session.
- If no choice has been made (or it is no longer valid), the system falls back to the first active membership.
- Only companies in which the customer has an active membership and that are themselves active are eligible.
How customers switch companies
- The account sidebar shows an Active company section.
- If the customer belongs to several companies, a Switch company dropdown lists all companies to choose from.
- After selecting, the shop confirms with "Active company switched." and stays on the current page.
If the customer belongs to only one company, the company name is shown without a switcher.
INFO
When switching, the shop verifies server-side that the customer is actually an active member of the chosen company. A tampered company identifier simply results in "The company could not be switched."
Roles overview
Each membership carries a role that determines what the member may do in the company:
| Role | Storefront label | In short |
|---|---|---|
| owner | Owner | Full management, including granting the owner role. |
| admin | Administrator | Manages members and addresses, but has no owner privileges. |
| member | Member | Acts for the company, without management rights. |
Details on rights, status and protection rules are on Members & roles.