Create a comparison table for affiliate products

Build a responsive comparison table with prices, badges and your own technical data – automatically or with your own compare table template.

A comparison table puts several products side by side: image, price, rating, test result and your own technical data such as pump pressure or water tank size. Visitors see the differences at a glance and click the buy button of the product that fits. On smartphones the table switches to a layout that stays readable.

Prerequisites: affiliate-toolkit with the Responsive Compare Table module (included in the passes) and some imported products. For your own data rows you also need the Custom Fields module.

A comparison table of four coffee machines with predicate badges, images, prices, the custom field rows of the field group and buy buttons.
A comparison table of four coffee machines with badges, prices, custom field rows and buy buttons.

The automatic comparison table

The fastest way is the system template comparetable ("Compare table (automatic)"). Pass the products or a list to it:

[atkp_list id='123' template='comparetable'][/atkp_list]
[atkp ids='101,102,103,104' template='comparetable'][/atkp]

The table shows the standard fields and, if you use field groups, your own fields automatically. The module also adds the templates detaillist ("Productbox with data sheet (automatic)") and datasheet ("Data sheet (automatic)") that show the same data per product.

Adjust the automatic table

You configure the automatic table under affiliate-toolkit → Settings → Compare Table:

  • Yes symbol / No symbol (html) – what is shown for yes/no fields, for example a check mark.
  • Predicate 1–3 (html) – text and colour of the badges such as "Test winner", "Best value" or "Our tip". You assign a predicate to a product on the product itself.
  • Max products – how many products appear side by side. Further products of the list are not shown.
  • Price position – price at the top, at the bottom or both.
  • Show Testresult, product button, primary button, Additional offers, manufacturer, availability – switch the corresponding rows on or off. The additional offers row follows the global "more offers" options in the display settings.
  • Hide empty rows – hides custom field rows that are empty for all products in the table.
  • Horizontal scrollbars (on desktops) – shows a scrollbar instead of squeezing the columns when the page is too narrow.
  • Hide headers (desktop) – hides the row captions on desktop.
Settings → Compare Table: yes/no texts, predicate texts and colours, maximum number of products and which rows (availability, manufacturer, test result, buttons, more offers) are shown.
Settings → Compare Table: symbols, predicates, number of products and visible rows.

Add your own technical data

Technical data comes from field groups of the Custom Fields module:

  1. Create a field group under affiliate-toolkit → Field groups, add your fields (text, number, yes/no …) and assign the group to a product category, for example "Coffee machines".
  2. Assign this product category to your products.
  3. Fill in the values on the Custom Fields tab of each product.
The field group "Coffee machine specs" with pump pressure, water tank, milk frother, grinder and power, assigned to the product category "Coffee machines".
The field group "Coffee machine specs" assigned to the product category "Coffee machines".

The comparison table then shows one row per field automatically. Details on field types and global fields are in User defined fields.

Fill in the values per product

On the product, the fields of all field groups of its category appear next to the global fields. Values you leave empty are shown as empty cells – or hidden completely with "Hide empty rows".

The "Custom Fields" tab of a product with the global fields and the fields of its field group filled in.
The Custom Fields tab of a product with the values of its field group.

Your own comparison table template

For full control, create a template of the type Compare table. The easiest way is to duplicate the system template under affiliate-toolkit → Templates and adjust the copy.

The templates page filtered to the system templates supplied with the plugin, each with its shortcode and a duplicate function.
The system templates with the duplicate function.

A compare table template consists of rows ("comparative values"). For each row you set:

FieldMeaning
CaptionRow heading shown in the header column.
DescriptionTooltip shown when the visitor hovers over the caption.
ViewWhether the row appears in the desktop table, the mobile view or both, and how the value is aligned (left, centered, right).
CSS ClassYour own CSS class for the cell.
DetailThe cell content: placeholders such as %title% or %price% with any HTML around them. Enter <!-AUTOROW-> to insert all custom fields of the field groups at this position.

Settings for the whole template:

  • Type of display – desktop only (always the table), mobile only (only the mobile view) or desktop and mobile (switches by screen width).
  • Max products and Max products (mobile) – products side by side on desktop and below each other on mobile.
  • Horizontal scrollbars (on desktops) and Hide headers (desktop) – as in the settings above.
  • Handle fieldgroup as group – shows the custom fields grouped by field group with a heading per group. Useful when you compare many values.
  • Mobile template – the template used for the slim view on small screens.

The template only defines the layout. Which products appear is decided by the shortcode or list you use it with.