Skip to main content
With the table display, the customer sees all variant combinations of a product at a glance instead of selecting them one after another. This is suitable for products with few combinations and lets the customer add several variants to the shopping cart at the same time. Two dependent variants “color” and “size” with ten combinations, for example, result in this table:

When a table fits

Technically, WEBSALE V8s supports up to 100 variant combinations in the table. This value is an upper limit of the system, not a guideline. A table with 100 rows suffers equally in clarity, usability, page design, and load time. Products can have several hundred or even several thousand combinations. For those, only the display via select lists makes sense, because only part of the variants appears at any one time. For that reason, do not decide across the board, but on a per-product basis. In the template, you set a maximum value for variant combinations. We recommend 25:
  • A product with no more than 25 combinations appears as a table.
  • A product with more than 25 combinations appears as a select list.

Which product data belongs in the table

Any product data can be displayed. Alongside the variants themselves, that is, color and size, we recommend:
  • the product number
  • the product image, if it depends on the variants
  • the price, if it depends on the variants
  • stock or availability, if present
  • an input field for the quantity

One or several quantity fields

For quantity input, there are two designs, and the choice determines how much the customer can order in one go. One quantity field per row. As in the table above. This lets the customer add several variants to the shopping cart at once, for example two red ones in size M and one blue one in XXL. A single quantity field for the entire table. In that case, the customer must first select a variant, which is why the rows are linked. If, for example, the customer clicks on product number 1007, its data appears in a “Your selection” block and can be added to the shopping cart from there. To check in the template whether a product number has already been chosen, use ST-DepVar_OK.

Integration

The table is built into the single-product template.

Set the maximum value in the template

In the WS-Config section, you specify up to which number of combinations the table is used.
Reference: WS-Config

Build the table

The bracket PR-SeparateDepVariations decides on the display. In the positive branch you build the table, in the negative branch the select lists or links. Both branches belong in the template, otherwise products beyond the maximum value are left without variant selection. Inside the table, the bracket of the variant names takes on a second task: it generates the columns dynamically. If a product has only the variant “color”, only this column appears. If it has color, size, and type, three appear. The same template thus serves all products.
Note the order of the brackets. CAT-AdvData($DepVariations,99) initializes the list of combinations, and only then does the @PR-Data loop deliver one combination per iteration.

Tags

Styles

Reference: Styles for products
  • Guide: Display variants
  • Guide: Display dependent variants as select lists
  • Guide: Display dependent variants as links
  • Guide: Reload dependent variants via AJAX