Skip to content
B2B commerce

Variant Matrix in the B2B Shop: Sizes and Colors in One Go

A variant matrix lets B2B buyers order sizes and colors in one table: stock per cell, tier pricing across the total, a mobile list. What Shopware CE offers.

18 min read VariantenSchnellbestellungShopwareBerufsbekleidung

In short and in plain language

Companies often buy clothing for many people. Then they need one jacket in many sizes and colors. In the store you pick each size on its own. That takes a long time.

A table helps. The sizes are in the rows and the colors in the columns. You type the amount into each field. One click puts everything in the cart.

Each field also shows how many are in stock. If a color does not exist in a size, the field is gray. The price for large amounts can count all sizes together.

On a phone the table turns into a list. The buttons are big enough for a finger.

The free version of Shopware has no such table. We build it for you.

A workwear distributor receives an order from a trade business: 30 softshell jackets spread across five sizes and two colors, plus safety shoes from size 39 to 46. A fastener distributor receives hex bolts in four diameters and six lengths. In both cases the order concerns one product with many variants, and in both cases the customer is not ordering a single variant but a distribution. In the online store that often means: pick a size, pick a color, enter a quantity, add to cart, back to the selection, and repeat that twelve times. Or the buyer types the list into an email. This article shows what a variant matrix looks like when it presents every combination of a product as a table with quantity fields: stock and delivery time per cell, minimum quantities and tier pricing across the total, grayed-out combinations that do not exist, and a list view for smartphones. It also covers what Shopware CE offers out of the box, where its limits are and what slows the page down when there are many variants.

Key takeaways

  • Shopware CE shows variants as one selection per property with a single quantity field for the chosen combination (Shopware source code 6.7.16.0). A table with quantity fields for all sizes and colors is built as an extension.
  • Each cell of the matrix shows the quantity field, stock and delivery time of its variant. Combinations that are not carried are grayed out and have no field, and low stock gets its own marker.
  • In Shopware CE, the tier price depends on the quantity of the individual cart line item. To apply it across all sizes and colors of a product, the extension adds up the quantity of the product family.
  • One click adds every filled cell to the cart as a separate line item with its own item number. Each variant reaches the ERP, and shortfalls are reported per cell instead of for the whole order.
  • Large matrices cost load time: the Lighthouse documentation lists roughly 800 nodes in the body as the warning threshold (Chrome for Developers). Stock is therefore loaded in one batch, and the summary row recalculates without rebuilding the table.
  • On smartphones the table becomes a list per color with minus and plus buttons. Targets need at least 24 by 24 CSS pixels (W3C, WCAG 2.2) so that quantities stay easy to hit.

Why B2B buyers order sizes and colors in bulk

In consumer retail, someone buys one jacket in size L. In B2B, a company buys the jacket for its workforce: eight in M, twelve in L, six in XL, some of them in high-visibility color for the construction site. The same applies to safety shoes, gloves, cable ties, wall plugs and screws. There, the variant axes are not size and color but diameter and length, or cross-section and color. The pattern stays the same: one base product, many versions, and an order that spreads across many of them.

As long as the store has no dedicated path for this, the order arrives through other channels. 89 percent (Bitkom) of wholesalers and retailers in Germany that sell online accept orders by email, barely fewer than the 97 percent (Bitkom) that run their own online store. The survey covered 505 companies from wholesale, retail and motor vehicle trade with at least ten employees (Bitkom). A size list in an email has to be keyed in by the sales back office line by line, and that produces exactly the errors a store is meant to prevent: the wrong size, a swapped color, an overlooked line.

In B2B, the online store is a sales channel that carries weight. In the EU in 2024, 4.34 percent (Eurostat) of total enterprise turnover came from web sales to other enterprises and public authorities, covering enterprises with ten or more employees (Eurostat). Orders also arrive straight from the customer's system: in EU trade including motor vehicle repair, 10.51 percent (Eurostat) of turnover came from EDI sales in 2024. For the many businesses without such a connection the store is the way in, and there a distribution across sizes and colors has to be quick to enter.

What Shopware CE offers out of the box

In Shopware, variants are created from properties: the properties serve as the basis for creating the variants (Shopware documentation). The variant generator in the Administration combines the selected options, for example five sizes and four colors into twenty variants. Value exclusion lets you leave out combinations from the start; the documentation's example is a T-shirt that is not offered in size L in blue (Shopware documentation). After that, each variant is a product of its own with an item number, price and stock.

In the Storefront, Shopware CE presents these variants as one selection per property: radio buttons, color swatches or a dropdown, followed by a quantity field and the buy button. We checked this on version 6.7.16.0, both in the Storefront source code and on a rendered product page with variants in a test store. The page has one quantity field, and it applies to the combination currently selected (Shopware source code 6.7.16.0). Options that do not form a valid variant with the current selection are marked as not combinable by the template (Shopware source code 6.7.16.0). A table with quantity fields for every combination does not exist out of the box, and the documentation only describes variant maintenance in the Administration.

The Administration is well prepared for many variants. In the variant overview you can change the price, stock and item number of each variant directly in the list (Shopware documentation), and bulk edit takes up to 1,000 (Shopware documentation) variants at once. For the product listing there are several display modes, from the main product without a preselected variant to variants fanned out by property value (Shopware documentation). What is missing is the customer's side: a form in which twenty quantities are entered at once. An extension of the kind we build in Shopware development closes that gap.

TaskShopware CE out of the boxWith a variant matrix
Create variantsvariant generator from properties, value exclusionunchanged, the matrix reads the same variants
Enter quantitiesone quantity field for the selected combinationone quantity field per combination in a table
Combination not carriedoption marked as not combinablecell grayed out, no quantity field
Stock and delivery timefor the selected variantper cell, loaded in one batch
Tier priceper cart line item, i.e. per variantoptionally across the total of the product family
Add to cartone variant per clickall filled cells in one step

Layout: axis by axis with quantity fields

The matrix is a table: one variant axis forms the rows, the other the columns, and each cell holds a quantity field. Which axis goes where depends on the number of values. The longer axis goes into the rows, because a table grows downward more gracefully than sideways. For workwear that is usually the sizes, for screws the lengths, for gloves the sizes again.

If a product has a third axis, such as regular, long and short fits or a cut, it is not folded into the table. It sits above the matrix as a switch, and each value gets a table of its own. A cube of three axes on one screen is hard to read. Quantities already entered are kept when switching, and the summary row counts across all tables.

Quantity field

One number field per combination, checked against the minimum, purchase steps and maximum of the variant.

Stock

Available quantity or a traffic light per variant, with its own marker as soon as stock runs low.

Delivery time

Delivery time of the variant and, when it is out of stock, the date from which it is available again.

Status

Combinations that are not carried or discontinued are grayed out and have no quantity field.

Surcharge

A note in the cell when the variant price differs, for example for oversizes.

Item number

The variant number, shown when the field has focus, so buyers can check it against their own lists.

The order of sizes and colors comes from the Administration, where you can define the order of the properties and of their options (Shopware documentation). That way S comes before M and L rather than alphabetically after them. For surcharges on oversizes, a note in the cell is enough when the price differs from the rest of the row. A full price in each of the twenty cells makes the table unreadable.

Stock and delivery time per cell

A matrix without stock tempts buyers to enter quantities that cannot be delivered. Each cell therefore shows what is available for that variant, per variant rather than per product. The total across all sizes says nothing about whether XL can be delivered. Shopware keeps stock, delivery time and restock time per product and therefore per variant; for items not in stock, the restock time is added to the delivery time (Shopware documentation). A product marked as a clearance sale cannot be sold once its stock is depleted (Shopware documentation). In the matrix, that cell is locked at zero stock instead of offering a field that only fails in the cart.

Three levels are usually enough for the display: available with a quantity or traffic light, low with its own marker, and out of stock with a delivery date. Low means the stock is below a threshold you define per product group. Anyone who enters more than is available gets the notice right at the cell, with the choice of taking the available quantity or ordering the rest for a later date. Whether partial deliveries are allowed is a question for your terms of delivery, not for the interface; the matrix only shows what the rule allows.

In most B2B stores, stock comes from the ERP. What matters is the path: a matrix with twenty cells must not trigger twenty individual requests. The extension fetches the stock of all variants of a product in one batch, from the store or through the ERP integration, and caches the result briefly. How a stock figure turns into a reliable delivery date is covered in our article on real-time availability in the B2B shop.

Keep two states apart

Not carried and out of stock are two different states. A combination that will not be offered is grayed out and has no quantity field. A variant that is temporarily missing keeps its field and shows the delivery date. Mapping both to zero stock loses orders for goods that could be restocked.

Minimum quantities, packs and tiers across the total

Shopware CE supports a minimum order quantity, purchase steps and a maximum order quantity per product. Below the minimum, the product cannot be placed in the cart (Shopware documentation). Purchase steps of 2 mean that customers can buy 2, 4 or 6 units, but not 1, 3 or 5 (Shopware documentation). The maximum limits the amount a customer can order of the product per order (Shopware documentation). For screws sold in packs or gloves in multipacks, purchase steps are the right tool. The matrix checks every entry immediately and does not round silently; it shows the next valid quantity instead. How sales units, pack sizes and order intervals are kept apart in the store is covered in our article on units of measure and pack sizes.

Tier pricing is where it gets interesting. In the Shopware cart, each variant is a line item of its own. A line item represents an order position according to the developer documentation (Shopware developer documentation), and its price is calculated by applying the quantity and the tax rate (Shopware developer documentation). In the source code, price calculation selects the tier by the quantity of that one line item (Shopware source code 6.7.16.0). If a company orders ten jackets in navy and twelve in anthracite, a tier starting at 20 units sees two quantities below 20. Customers find that hard to follow, because from their point of view they ordered 22 jackets of the same model.

The matrix solves this with a rule you define: the tier applies to the total of all variants in a product family, to the total per color, or per variant as before. The extension adds up the family's quantity, applies the tier price to every line item and shows in the summary row which tier has been reached and how many units are missing for the next one. Standard features only get you close: the Rule Builder has a condition that compares a number with the total quantity of all products in the cart and can be filtered (Shopware documentation). A promotion built on it, however, only takes effect in the cart and not as a price in the table. How price lists and tiers are set up in Shopware in general is explained in our article on B2B price lists and tier pricing.

It is important that the ERP does the same math. If the store applies the tier across the family and the ERP per line item, the order shows different prices than the cart. The rule therefore belongs in one place, usually the ERP, and the store adopts its result.

One click, many line items: the path into the cart

The button below the matrix adds all filled cells to the cart at once. Technically, the cart does not need to be rebuilt for this: the Storefront route for adding items accepts a list of line items in one request and checks each line item on its own (Shopware source code 6.7.16.0). The matrix therefore sends one request with eleven line items instead of eleven requests in a row.

Each variant remains a line item of its own with its own item number. That is intentional: ERP, warehouse and invoice work with the variant number, not the base product number, and under the rules for item numbering each different size or color of a garment has its own identification number (GS1). The alternative, a container line item with child items, looks tidier in the cart but has to be unfolded again at every interface. We only use it when the ERP explicitly expects such records.

Errors are reported per cell. If a variant sells out between entry and submission, or a quantity does not fit the purchase steps, the remaining line items still go into the cart and the affected cell stays in place with a notice. Quantities already entered are not lost. Customers who order the same distribution regularly save it as an order list; how quick entry, CSV upload and lists work together is shown in our article on B2B quick order.

  • Minimum, purchase steps and maximum per cell, with the next valid quantity as a suggestion.
  • Stock per variant at the time of submission, not only when the page loads.
  • Visibility and purchase rights of the customer account, for example when a color is released for one customer group only.
  • Tier price according to the defined rule, with the tier reached displayed.
  • A status message for screen readers stating how many line items were added to the cart and which were not.
  • A log of partial successes so the sales back office can answer questions.

Many variants, heavy load: page weight and input

Five sizes by four colors make twenty cells. Safety shoes in eleven sizes and several widths, screws in eight diameters and fifteen lengths, work trousers by waist and inside leg: soon there are a hundred cells or more on one page, each with a field, stock and a label. The number of nodes in the document grows with them. For its DOM size audit, the Lighthouse documentation lists a warning when the body element has more than roughly 800 (Chrome for Developers) nodes and an error from roughly 1,400 (Chrome for Developers) nodes. As of Lighthouse 13, this audit has moved into the "Optimize DOM size" insight (Chrome for Developers).

Responsiveness to input matters just as much. Every digit typed into a quantity field changes the summary row, the tier and perhaps the stock notice. A good Interaction to Next Paint is 200 milliseconds (web.dev) or less. Rebuilding the entire table on every keystroke quickly exceeds that with large matrices. The summary row therefore only recalculates the changed values, and stock and tiers are refreshed after a short pause in typing.

On the server side the same principle applies as for stock: load in batches. Prices, stock and states of all variants come in one query, and very large matrices show the frequently ordered rows first and expand the rest on demand. For the product listing this means that fanning out all variants multiplies the hits. For products with a matrix, the main product with a note on the number of versions is usually enough. How we measure and reduce load times is described on our performance page.

Mobile: the table becomes a list

A table with four colors and five sizes fits on a monitor but not on a smartphone in portrait mode. The Web Content Accessibility Guidelines require content to be usable at a width of 320 CSS pixels (W3C, WCAG 2.2) without scrolling in two directions. Data tables are exempt because they need the two-dimensional layout for their meaning (W3C, WCAG 2.2). That does not make it any more convenient for a buyer in the warehouse to push a wide table back and forth with a thumb.

The mobile version therefore rearranges the matrix: one collapsible group per color, the sizes listed below each other, each with stock and a quantity field with minus and plus buttons. The summary row stays visible as a slim bar at the bottom. Targets have a minimum size of 24 by 24 CSS pixels (W3C, WCAG 2.2); for fields that sit close together, more area is more comfortable. The quantity field opens the numeric keypad.

For accessibility, the table needs header cells for rows and columns and a label per field that names size and color, such as "Quantity, size L, color navy". Grayed-out cells are announced as unavailable rather than only marked by color. The feedback after clicking the buy button is a status message. If you add the matrix to a product page that has already been audited for accessibility, include it in the next audit of the product template.

Matrix, configurator and quick order compared

Three features sound similar and solve different tasks. What matters is what the customer already knows when ordering.

AspectVariant matrixProduct configuratorQuick order
Starting pointproduct and variants are fixed, the question is how to distribute the quantitya valid version has to be found among many attributesthe customer knows the item numbers
Inputquantity per combination in a tablestep-by-step selection with rulesnumber and quantity per line or as a CSV file
Resultmany line items of one productone configured line item, often with a quotemany line items of different products
Typical rangesworkwear, shoes, gloves, fastenersdrives, machine parts, custom buildsconsumables, spare parts, reorders

The features complement each other. If a valid version still has to be found, the product configurator is the right tool. Anyone who knows item numbers from their own system orders through quick entry. The matrix is built for the case where the product is fixed and quantities spread across many variants, which is common in technical trade and in wholesale.

Roadmap to your first matrix

  1. Select product groups where orders spread across many variants, and start where most size lists arrive by email today.
  2. Define axes and order: which axis goes into the rows, which into the columns, and whether a third axis serves as a switch.
  3. Clarify the states coming from the ERP: carried, out of stock with a date, not carried, discontinued, and how each state looks in the cell.
  4. Define the rule for tiers and minimum quantities, per variant, per color or across the product family, and store the same rule in the ERP.
  5. Build the data path: load stock and prices of all variants in one batch, with a short cache time.
  6. Implement the matrix as an extension, including the mobile list view, labels and status messages.
  7. Test with real orders: partial success, a sold-out cell, wrong purchase steps, and measure the number of nodes for the largest matrix.

Afterward, measure what changes: the share of orders still arriving by email, the number of line items per order and the questions the sales back office receives about sizes and colors. If you sell seasonal goods such as winter jackets early, combine the matrix with a pre-order in the B2B shop: the retailer enters the distribution once and chooses the delivery date per line item.

How we build variant matrices in Shopware

As part of our Shopware development we build the variant matrix as an extension for Shopware CE: a table and a mobile list on the product page, stock and delivery time per cell, grayed-out combinations, tiers across the product family and the batched path into the cart. You keep maintaining the variants in the variant generator; the matrix only reads them. Stock, prices and tiers come through the connection to your ERP, and the order goes back with one line item per variant.

Customers who order the same distribution regularly find their matrix orders in the customer portal and can reorder them. For ranges with their own price lists, approvals and several buyers per company, the matrix belongs in a B2B portal. We work out which product groups pay off first based on your orders from recent months; get in touch through our contact page.

This article is based on data from: Bitkom, study report "Digitaler Handel in Deutschland" (company survey 2025), Eurostat, Statistics Explained "E-commerce statistics" (2024 data), Shopware documentation (Products, Rule Builder), Shopware developer documentation (Cart), Shopware source code (version 6.7.16.0), GS1 General Specifications (Release 26.0), W3C (WCAG 2.2), Chrome for Developers (Lighthouse, DOM size) and web.dev (Interaction to Next Paint). We also checked the default behavior of Shopware CE on a product page with variants in a test store. Products, sizes, colors, quantities and stock levels in the graphic and examples are chosen for illustration.

Related Articles

B2B commerce

B2B Quick Order and Order Lists in Shopware Portals

Quick order by SKU, CSV upload and saved order lists in Shopware: how recurring B2B buyers order in seconds instead of minutes and relieve your sales team.

13 min read
B2B commerce

Black Week in Your B2B Shop: Deals for Business Customers

Black Week in a B2B shop: when the German 30-day lowest price rule applies, what unfair competition law requires and how to limit deals in Shopware CE.

23 min read
B2B commerce

Pre-Orders in the B2B Shop: Sell Seasonal Goods Early

Pre-orders in the B2B shop: order windows and delivery dates per seasonal item, valuta from delivery, minimums, cut-off dates and ERP handover on Shopware CE.

20 min read