Free Magento 2 Spare Parts Module: Show the Right Part on the Right Product

“Which part fits this model?” is the question every equipment, machinery and automotive parts seller gets on repeat. On most Magento stores the answer lives in a PDF, a spreadsheet, or the head of one experienced person in sales. Every time a buyer has to ask, it becomes an email, a phone call or a support ticket instead of an order.

We touched on this in our post on what B2B buyers actually want from a self-service portal. This is the deeper look at the module we built for it: Spare Parts, a free Magento 2 extension.

The Idea: A Part Is Just a Product

The simplest way to model “this machine takes these parts” in Magento is also the one that holds up best: link products to products. A spare part is a regular catalog product. It has its own SKU, price, stock status, images and add-to-cart button. The module only adds the relationship between a parent product (the machine, the device, the model) and the parts that belong to it.

That sounds almost too plain, but it matters. Because parts are real products, everything Magento already does for products keeps working: inventory, tier prices, customer group pricing, search, layered navigation, and QuickOrder if you use it. There is no parallel catalog to maintain.

What the Buyer Sees

Two places on the storefront:

  • A “Replacement parts” block on the product page. The buyer opens the machine, and the parts linked to it are right there as a product grid with price and add to cart. No PDF, no phone call.
  • A dedicated listing page. When a machine has many parts, a short block is not enough. The “View all” link opens the full list at /replacement-parts for that product, with Magento’s layered navigation so the buyer can filter down instead of scrolling.

Both are controlled from the store configuration: how many items to show on the product page, whether to show the block only when parts are in stock, and the threshold after which the “View all” link appears.

What the Admin Does

On the product edit page there is a dedicated Spare Parts tab. Switch on “Show Spare Parts”, pick the parts in a product picker grid, save. Links can be set per store view, so a catalog with different assortments per market does not need a workaround. Access is controlled by its own ACL resource, so you decide which admin roles may edit the links.

There is also a REST endpoint, GET /V1/replacement-parts, that returns the parts linked to a product. It is useful when the data has to reach a mobile app, a headless frontend or a dealer portal.

Hyvä Storefronts

The product page block ships with Luma markup. For Hyvä stores there is a small companion module, Spare Parts Hyvä, that replaces it with native Tailwind cards and a plain HTML add-to-cart form, with no jQuery or RequireJS dependency. The full listing page already works on Hyvä without it, since it reuses Magento’s own category and layered navigation templates.

Where This Gets Scoped Wrong

We have seen the same three mistakes on parts projects, with or without our module.

  • Treating a direct link as a fitment database. Product-to-product links answer “what parts belong to this machine”. They do not answer “which parts fit a 2019 model with this engine variant”. If your buyers search by year, make and engine code, you need structured fitment data on top. The simple link covers a surprising number of catalogs, but be honest about which kind you have before you commit.
  • Linking everything by hand, forever. A part that fits 30 machines needs 30 links. For a small catalog that is fine. For thousands of parts, plan the import from your ERP or PIM from day one, not as a phase two.
  • Forgetting what happens when a part is discontinued. A spare part block that shows a dead item is worse than no block. This is exactly why we built discontinued product handling to work together with the parts, instead of as a separate dead end.

Installation

composer require brosolutions/spare-parts
bin/magento module:enable BroSolutions_SpareParts
bin/magento setup:upgrade

For Hyvä, add brosolutions/spare-parts-hyva as well. Both are on Packagist: brosolutions/spare-parts and brosolutions/spare-parts-hyva. The module is free and released under the MIT license. Source code: GitHub.

Need Help With Parts in Magento?

If your parts data lives in an ERP, needs fitment logic, or has to connect with QuickOrder and discontinued products, that is the kind of work we do. Write to contact@brosolutions.net and tell us how your buyers find parts today.