Installation
Requirements
| Craft CMS | 5.3 or later |
| PHP | 8.2 or later |
| Craft Commerce | 5.0 or later — optional, needed only for the price, SKU, stock and add-to-cart rows |
Commerce is a soft dependency. Compare works perfectly well on a content site with no shop; a compare set of entries or categories never touches Commerce code.
Install
composer require justinholtweb/craft-compare
php craft plugin/install compare
Or find Compare in the Craft Plugin Store and install it from there.
Editions
| Lite | Pro | |
|---|---|---|
| Price | Free | $79, then $29/year |
| Compare sets | 1 | Unlimited |
| Items per comparison | 3 | Up to 10 |
| All core row types | ✓ | ✓ |
| Guest + user lists, merged on login | ✓ | ✓ |
| Bar, modal, standalone page, print | ✓ | ✓ |
| Twig API + JSON endpoints | ✓ | ✓ |
| Custom table templates | ✓ | ✓ |
| Difference highlighting and "differences only" | — | ✓ |
| Twig template rows | — | ✓ |
| Shareable comparison links | — | ✓ |
| Insights | — | ✓ |
Lite is a complete comparator, not a demo. A shop with one catalogue and a three-up table — which is what almost every comparison table on the web actually is — never meets a paywall.
A lapsed Pro licence narrows rather than breaks: the table drops to three columns and Twig rows are skipped, but the page keeps working and nothing stored is changed. Renewing brings it all back.
Your first comparison
1. Create a compare set
Settings → Compare → Sets → New compare set.
- Name and handle — the handle is what templates and endpoints use.
- What does this set compare? — Entries, Categories, or (with Commerce) Products or Variants. One element type per set; comparing a sofa against a blog post is not a comparison.
- Which ones? — tick the sections, category groups or product types in the set. Tick nothing to include all of them.
- Maximum items — how many go side by side. Three fits a phone.
- Table rows — add rows, pick a type, drag to reorder. Start with Title, Image, and two or three fields your customers actually weigh against each other.
2. Add a compare button
In whatever template renders your product cards:
{{ craft.compare.button(product) }}
3. Add the bar once, in your layout
{{ craft.compare.bar() }}
That is the whole integration. Visitors add things, the bar appears, "Compare (3)" opens the table,
and /compare shows the same table as a page they can bookmark and print.
What gets installed
Four database tables (compare_sets, compare_lists, compare_items, compare_events), a
Compare control-panel section, and a front-end runtime that loads only on pages that actually
have a compare control on them.
Compare makes no outbound requests of any kind and ships no third-party code — no jQuery, no CDN, no analytics.
Uninstalling
php craft plugin/uninstall compare
This drops all four tables, which means every visitor's comparison goes with them. The compare sets
live in project config, so remove them from config/project/ too if you are not reinstalling.