Fitment setup: finder, garage and fit checks
Create the fitment definition, add your vehicles, machines or equipment, connect products and add the filter so every page shows what fits.
Fitment is the list of vehicles, machines or equipment each product fits. The theme reads it to answer one question on every page: does this fit what I own?
How it works
- Every vehicle, machine or piece of equipment is one entry in a Shopify metaobject.
- Each product has one metafield,
parts.fits, that lists the entries it fits. - A product that fits everything, such as an oil or a hand tool, lists one entry named "Universal fit".
- A product with no entries shows no fit state. It is neither a match nor a mismatch.
- Shopify's Search & Discovery app filters collections by that metafield, so a collection can open already filtered to what the visitor owns.
This design handles parts that fit hundreds of vehicles, and it never offers a combination that doesn't exist, such as a 2018 Ford Camry.
Step 1: create the fitment definition
In your Shopify admin, open Settings, then Custom data, then Metaobjects, and add a definition.
| Preset | Definition type | Fields |
|---|---|---|
| Auto parts | vehicle |
name, year (integer), make, model, trim, engine |
| Tools and hardware | machine |
name, brand, type, model, year (integer) |
| Trade supplies | equipment |
name, brand, model, type |
Turn on Storefront access for the definition. Only name has to be required, so an entry like "Universal fit" can exist without the other fields. A step with no values on the visitor's path is skipped, so a machine without a year still works.
The name field is what visitors read, for example "2018 Ford F-150 XLT 5.0L V8" or "Halden HM-210 push mower (2021)".
If you already have your own definition, keep it. In the finder block settings, enter its type, the field keys and the label for each step.
Step 2: add the entries
Add one entry for every configuration you sell parts for, and one called "Universal fit" with the handle universal.
Shopify has no native CSV import for metaobject entries. Pick one of these:
- In the admin. Fine for a few dozen entries.
- A CSV import app. Several apps in the Shopify App Store import metaobject entries from a spreadsheet. The theme doesn't depend on any of them.
- The Admin API. A developer can load entries with the
metaobjectUpsertmutation. This is how the demo stores are loaded, and the loader is open for reference.
The finder reads up to about 2,500 entries comfortably. For larger databases, such as a full vehicle database for every make, a fitment app is a better fit than this setup.
Step 3: add the product metafield
- Open Settings, then Custom data, then Products.
- Add a definition with namespace and key
parts.fits, type List of metaobject references, pointing at your fitment definition. - Turn on Storefront access.
Open a product and pick the entries it fits from the searchable list. Shopify accepts several hundred references on one product.
Step 4: add the filter
- Install Search & Discovery from the Shopify App Store. It is a free app made by Shopify.
- Open Filters and add a filter on the product metafield
parts.fits. - Label it Vehicle, Machine or Equipment, and set the logic to OR.
The theme sends the active entry plus "Universal fit" to this filter, so a collection shows parts that fit and universal parts together. The theme hides the raw filter in the sidebar and shows its own fit switch and fit bar.
Limits to know
- Shopify returns at most 100 values for a filter, so the finder reads the entries themselves instead of the filter values.
- Collections over 5,000 products show no filters in Shopify. Split large catalogs into category collections under that size.
- Product pages with more than 50 fitment entries load the compatibility list in pages when it opens.
- Fitment is set per product in this version. Variants share the product's fitment.
Testing
- Open your store and set an entry in the garage.
- Open a collection. The fit bar shows how many products fit.
- Open a product that fits, one that fits other entries only, a universal one, and one with no fitment data. Each shows a different fit state.