Formula comparison

A comparison across up to four products, measured on rows you define — strength, texture, frequency, pairing, or anything else. On a product template it leads with the product being viewed and lets the customer choose what to compare it against.

Merchant-addable
Yes
Settings
42
Block types
2
Max blocks
10
File
sections/formula-comparison.liquid

Used by default on: Product

When to use it

When customers ask "which one is right for me" and the answer depends on more than price. Works as a fixed comparison on a collection or landing page, and as a per-product comparison on a product template.

Setting it up

  1. Add the section and write the heading and intro under Content.
  2. Define your measures under Comparison rows. These become the rows and apply to every column, so pick measures every product can actually answer.
  3. Give each row a Value source so it fills from each product's category attributes rather than typed text. The first three rows ship pointed at real attributes already. See Per-product content.
  4. Decide where the columns come from with Column products under Comparison columns. Leave it on formula blocks for a fixed comparison; switch it to the product being viewed on a product template.
  5. For a fixed comparison, add one Formula block per product, up to four — each picks a product and answers each row.
  6. For a per-product comparison, set Collection customers compare within and size it with Columns to compare. Every row then needs a value source, because a product the customer swaps in has no block to type into.
  7. Pick an Image ratio and check it on a phone — the comparison becomes a swipeable deck, one product per slide.

Where the content comes from

Product references, images, and prices come from Shopify product data. The measures are section content, and in the fixed mode each product's answers are block content, because they are specific to this comparison rather than facts on the product record.

Notes and cautions

  • Four columns is the maximum and three is usually better. A comparison a customer cannot hold in their head does not help them decide.
  • On a product template, two columns beside the product being viewed is the practical desktop maximum — the row labels plus four product columns need about 1140px and scroll sideways below that.
  • Rows still on Manual value are hidden once the columns come from the product, rather than showing an empty cell in every column. The editor names them.
  • It is not an HTML table. Each column is its own card so it can carry its own shadow, and every value carries a hidden row label, so screen readers still hear "Best for: dry, sensitive" without a table to navigate.

Two ways to fill the columns

A comparison built from product pickers has one problem on a product template: the template is shared. Pick three serums in the blocks and every product page in your store shows those same three serums — including the pages of the serums themselves.

So the section reads its columns from one of two places, set by Column products under Comparison columns.

ModeWhat fills the columnsWhere to use it
Product picked in each formula block (default)The products you picked, the same on every pageHome page, a collection page, a dedicated comparison page
Product being viewed, plus the customer’s choiceThe product on the page, then products the customer picksProduct templates

The second mode does two things at once: it puts the product being viewed in the first column automatically, and it lets the customer choose what to compare it against from a dropdown on each of the other columns.

It needs a product on the page. On a home page there is nothing being viewed, so the section falls back to your formula blocks and the theme editor tells you so.

The full walkthrough

Step 1 — switch the source

On your product template, open the section and set Column products to Product being viewed, plus the customer’s choice.

The formula blocks stop being used at this point. They are not deleted — switching back restores them — but hiding or reordering them changes nothing while this mode is on, and the editor says as much.

Step 2 — choose what customers compare within

Collection customers compare within sets the pool the dropdowns offer.

Pick the collection that holds comparable products — your serums, your moisturizers. Leave it blank and the section uses the smallest collection the product belongs to, on the reasoning that the smallest is usually the most specific: better to compare within “Vitamin C serums” than within “All products” or “Sale”.

Leave Compare only products of the same type on to keep a comparison to one kind of product. It reads Shopify’s Product type field, and is ignored on a product that has none — so if your comparison is offering unrelated products, that field is usually empty in admin.

Step 3 — give every row a source

This is the step that catches people out. A product the customer swaps in has no block to type a value into, so every row you want visible needs a Value source under Comparison rows.

Rows left on Manual value are hidden in this mode. They are not shown as empty — an empty comparison row is worse than no row — and the editor lists exactly which rows dropped and why.

See Per-product content for how value sources work and which attributes exist.

Step 4 — size the comparison

SettingWhat it does
Columns to compareHow many columns sit beside the product being viewed. 1–3.
Products customers can choose fromHow long each dropdown list is. 2–8.
Current product labelThe wording on the first column’s chip. Blank hides it.

Two columns is the practical maximum on a desktop. The row-label column plus the product being viewed plus three more needs about 1140px, so three columns is permanently scrolled sideways at normal page widths.

What the customer sees

The first column is the product they are already looking at, marked with the label from Current product label and given a quiet ring so it reads as theirs.

Every other column carries a dropdown naming the product in it. Opening it lists the pool, where:

  • the column’s own product is ticked
  • a product already shown in another column is greyed out with a dash, because two columns showing the same product is not a comparison
  • choosing one swaps that column, and only that column

Nothing reloads. Every choice is rendered with the page and swapped in place, so the comparison changes instantly and no images are fetched until a choice is actually made.

What renders in each situation

The situationWhat a customer sees
The collection has plenty of productsThe full comparison, with dropdowns
The collection has fewer products than Columns to compareFewer columns, and the editor says how many it found
The collection has nothing to compare againstNothing — the section is hidden
The product being viewed has no collectionFalls back to the smallest collection it belongs to; hidden if there is none
The section sits where no product is being viewedYour formula blocks, as normal
A row has no value sourceThat row is hidden, in every column

A product with nothing comparable hides the section rather than showing a one-column table. Every one of these states explains itself in the theme editor — if the section looks short or empty while editing, read the note under it.

How the choices are ordered

The dropdown offers the first products in the collection’s own sort order, skipping the product being viewed and anything filtered out by product type.

That means the collection’s sort order in Shopify admin is the ranking. There is no relevance scoring. If you want a particular product to be the default comparison, sort that collection manually and put it first.

Two things it deliberately does not do: it does not exclude sold-out products, because a comparison is still informative for something out of stock, and it does not narrow by tag or price.

Keeping the cards aligned

Rows only read as a comparison when they line up across the columns, so the section holds the media and the titles to a fixed shape:

  • Image ratio — Portrait, Square, or Landscape — applies at every screen size, so every column’s image occupies identical space. Square keeps cards shortest on a phone, where the comparison becomes a swipeable deck one card at a time.
  • Two lines are always reserved for a product title, so a short name and a long one do not offset the rows beneath them. Titles are never truncated, so a name long enough to need three lines will still push its own column down.

Using it well

  • Two columns beside the product, not three. A comparison a customer cannot see at once does not help them decide.
  • Point every row at an attribute before switching modes. Otherwise the comparison arrives three rows shorter than you designed it.
  • Keep the choice list short. Every option is prepared with the page, so eight choices is more page weight than four for a list most customers never open.
  • Set Product type on your products. It is what keeps a wax out of a serum comparison.
  • Test on two products — one in the collection with attributes filled in, and one with nothing. The second is how you confirm the section hides itself instead of showing an empty table.

When a column shows dashes

Work down this list:

  1. The product has no category. Value sources read category attributes, and those do not exist until the product has a category. This is the cause most of the time.
  2. The attribute is empty on that product. Assigning a category creates the field; it does not fill it in.
  3. The row is still on Manual value. In this mode that row is hidden rather than filled.
  4. The category does not carry that attribute. A cleanser category will not offer SPF level.
  5. You are looking at a product outside the collection. The comparison is built from the collection pool, and the product being viewed is always the first column regardless.

The fastest check is the product in Shopify admin. If the value is blank there, the theme has nothing to show.

Formula comparison design

100%

Use the zoom controls, then scroll to inspect the image. Press Escape to close.

Section settings

Every setting on the section itself, in the order it appears in the theme editor. Group headings match the editor's own grouping.

Content

EyebrowText
ID
eyebrow
Default
Formula comparison
HeadingText
ID
heading
Default
Compare the formulas
Heading sizeDropdown
ID
heading_size
Default
Large
  • Smallsmall
  • Mediummedium
  • Largelarge
SubheadingRich text
ID
subheading
Default
<p>Read two to four products across the same rows, so the right choice is easy to see.</p>
Content alignmentDropdown
ID
content_alignment
Default
Left
  • Leftleft
  • Centercenter

Comparison columns

Column productsDropdown
ID
columns_source
Default
Product picked in each formula block (same on every page)
  • Product picked in each formula block (same on every page)blocks
  • Product being viewed, plus the customer's choiceproduct
Collection customers compare withinCollection

Applies when column products is set to the product being viewed. Customers choose from the first products in the collection's own sort order, skipping the one they are viewing. Leave blank to use the smallest collection the product belongs to.

ID
comparison_collection
Current product labelText

Marks the first column as the product the customer is viewing. Leave blank to hide it.

ID
anchor_label
Default
You are viewing
Shown when
columns_source is 'product'
Compare only products of the same typeCheckbox

Keeps a comparison to one kind of product. Ignored when the product being viewed has no product type.

ID
match_product_type
Default
On
Shown when
columns_source is 'product'
Columns to compareSlider

Shown beside the product being viewed. Fewer columns show if the collection holds fewer products.

ID
comparison_columns
Default
2
Range
1 to 3, in steps of 1
Shown when
columns_source is 'product'
Products customers can choose fromSlider

The length of each column's list. Every choice is prepared with the page, so a shorter list keeps the page lighter.

ID
pool_limit
Default
6
Range
2 to 8, in steps of 1
Shown when
columns_source is 'product'

Comparison rows

Label column titleText

Optional text shown at the top of the left column.

ID
label_column_title
Tags shown per cellSlider

Extra tags collapse behind a control that customers can expand. Applies to rows using the tags style.

ID
tag_limit
Default
3
Range
2 to 6, in steps of 1
Price row labelText
ID
price_label
Default
Price

Call to action

Show the View product buttonCheckbox
ID
show_view_product
Default
On
View product button labelText
ID
view_product_label
Default
View product
Shown when
show_view_product

Style

Color schemeColor scheme
ID
color_scheme
Default
scheme-1
Label column widthSlider
ID
label_column_width
Default
200
Range
140px to 280px, in steps of 4px
Label illustrationDropdown

Show a decorative line illustration at the top of the label column.

ID
label_illustration
Default
Leaf
  • Nonenone
  • Botanical branchbotanical
  • Leafleaf
  • Mushroommushroom
  • Dropletsdroplets
  • Sunsun
  • Customcustom
Custom illustrationImage

Use a transparent PNG line illustration. 400 x 720px recommended.

ID
label_illustration_image
Shown when
label_illustration is 'custom'
Illustration rotationSlider
ID
label_illustration_rotation
Default
0
Range
-30° to 30°, in steps of 1°
Shown when
label_illustration is not 'none'
Illustration horizontal shiftSlider
ID
label_illustration_shift_x
Default
0
Range
-40% to 40%, in steps of 2%
Shown when
label_illustration is not 'none'
Illustration vertical shiftSlider
ID
label_illustration_shift
Default
0
Range
-40% to 40%, in steps of 2%
Shown when
label_illustration is not 'none'
Image ratioDropdown

Applies on every screen size. Square keeps cards shortest on a phone.

ID
image_ratio
Default
Portrait
  • Portraitportrait
  • Squaresquare
  • Landscapelandscape
Space between cardsSlider
ID
column_gap
Default
20
Range
8px to 40px, in steps of 2px
Use custom corner radiusCheckbox
ID
use_custom_corner_radius
Default
Off
Corner radiusSlider
ID
corner_radius
Default
16
Range
0px to 32px, in steps of 2px
Shown when
use_custom_corner_radius
Animate on scrollCheckbox

Reveal the comparison as it scrolls into view. Respects the theme motion settings.

ID
enable_entrance_animation
Default
On

Padding

Top paddingSlider
ID
padding_top
Default
64
Range
0px to 120px, in steps of 4px
Bottom paddingSlider
ID
padding_bottom
Default
64
Range
0px to 120px, in steps of 4px

Blocks

Blocks are added, reordered, duplicated, and removed inside the section. Each type has its own settings.

Comparison row row max 6

HeadingText

Names the row in the label column. A row with no heading is hidden.

ID
heading
Default
Benefit
Value sourceDropdown

Fills this row from each product automatically. The typed value for a product is used when it has no data for the attribute.

ID
attribute
Default
Skin care effect
  • Manual value (same on every product)manual
  • Skin typesuitable-for-skin-type
  • Skin care effectskin-care-effect
  • Skin care featuresskin-care-features
  • Active ingredientsactive-ingredient
  • Constitutive ingredientsconstitutive-ingredients
  • Cosmetic functioncosmetic-function
  • Ingredient originingredient-origin
  • Product formproduct-form
  • Moisturizer typemoisturizer-type
  • Texturetexture
  • pH levelph-level
  • Fragrance levelfragrance-level
  • SPF levelspf-level
  • UVA protection gradeuva-protection-grade
  • Certifications and standardsproduct-certifications-standards
Value styleDropdown
ID
style
Default
Text
  • Texttext
  • Tagstags
  • Time of dayschedule
  • Strength meterstrength

Formula formula max 4

ProductProduct

Title, image, link, and price are read from this product.

ID
product
Highlight labelText

Feature this product with a short label, such as Most loved. Leave blank for none.

ID
highlight_label
Price noteText

Shown after the price, such as / 30 ml.

ID
price_note

Row values

Row 1 valueText
ID
value_1
Default
Brightening and even tone
Row 2 valueText
ID
value_2
Default
Normal, Combination
Row 3 valueText
ID
value_3
Default
Serum
Row 4 valueText
ID
value_4
Default
AM
Row 5 valueText
ID
value_5
Default
30 ml
Row 6 valueText
ID
value_6
Default
3/5 Gentle