Need advice creating "Pairs With" section based on tags or meta

Topic summary

A store owner is building a hardware e-commerce site with thousands of products (bolts, nuts, washers) and needs an automated “Pairs With” section on product pages. The goal is to suggest compatible items (e.g., showing 3/8" zinc nuts and washers on a 3/8" zinc bolt page) without manually linking each product.

Core Challenge:

  • Manual pairing doesn’t scale for thousands of SKUs
  • Creating individual collections for each product grouping would result in thousands of collections
  • Needs a tag or metafield-based solution that works automatically during product creation

Proposed Solutions:

Initial suggestions (posts 2, 6):

  • Use shared tags (e.g., 3-8-zinc) or metafields to group related products
  • Implement dynamic Liquid code to display products with matching tags
  • Use Online Store 2.0 metafields as dynamic sources
  • Apps mentioned: Search & Discovery, Exilant’s Related Products

Technical corrections (posts 5, 7, 9):

  • The suggested collections.all.products | where: "tags" Liquid approach is flawed—it only inspects the first 50-250 products, making it unworkable for thousands of items
  • Storefront API with JavaScript is recommended as a more scalable solution

Refined approach (posts 11-13):

  • Use product-list metafield references or metaobjects for reusable groupings
  • Consider smart collections based on metafields, though this may still have scaling issues
  • Leverage Shopify’s built-in “Recommended products” feature, which learns from purchase patterns
  • Start with a simple manual prototype before automating

Current Status:
The discussion remains open. The store owner is leaning toward smart collections with metafields despite warnings about complexity. Experts emphasize that proper investment in custom development or consulting may be necessary, as simple solutions won’t scale effectively for this use case.

Summarized with AI on October 23. AI used: claude-sonnet-4-5-20250929.

I’m building a website for hardware such as bolts, nuts, washers, and many other items. On the product page to display something like a “pairs with” section. As example, for a bolt I want to display the correct nut(s) and washers (there will be several styles of nuts that would be shown) so the customer doesn’t have to go find them. They can just click them right there on the bolts product page and add them to the cart.

Here is my problem, we are going to be creating thousands of products and I cant do all of that product creation THEN go back through all the products to manually pair products together. What I would like is a way to group them using metadata or tags so I can enter that as I’m creating a product. And a product page section automatically display products based on those tags.

For instance maybe I would tag or metafield data “3/8 zinc” to the 3/8 zinc bolts, nuts, and washers to group them for display on the product page. So on the 3/8 bolt product page you see a suggested products that has the 3/8 zinc nuts and washers and on the 3/8zinc nuts page you see all the 3/8 zinc bolts and washers.

I cant really create collections for all of these because I will end up with far too many collections. As it is I’m already going to have several hundred collections and if I make a collection for every product’s suggested items there will be thousands of collections.

***The main thing is speed, I need to just add tags or metadata when creating products and everything just automatically happen based off that.

Any advice? Is there a app that would be helpful? All the “Add on” or “bundle” type apps I’ve seen so far you have to go through every product to manually add the suggested products to it.

Thanks!

Hey @stephenw :waving_hand:

That’s a really smart and practical idea — creating dynamic “pairs with” sections for hardware products will definitely improve UX and increase average order value.

You’re absolutely right that manually pairing each item isn’t scalable when you’re managing thousands of SKUs. The best way to automate this is by using product metafields or tags with dynamic filtering. Here’s how you can approach it:

  1. :puzzle_piece: Use Metafields or Product Tags for Grouping
    While creating your products, add a common identifier like 3-8-zinc or size_material as a tag or metafield.
    Example:

    • Bolt → tag: 3-8-zinc

    • Washer → tag: 3-8-zinc

    • Nut → tag: 3-8-zinc
      This shared tag can then be used to dynamically pull related products.

  2. :gear: Dynamic Section via Liquid Code
    In your product template, you can add a custom Liquid block that automatically displays products with matching tags:

    {% assign related_tag = product.tags | first %}
    {% assign related_products = collections.all.products | where: "tags", related_tag %}
    {% for related_product in related_products limit: 6 %}
      <!-- display related_product info -->
    {% endfor %}
    
    

    This lets you show all items that share the same tag, without creating hundreds of collections manually.

  3. :brain: Alternative: Use Shopify Metafields + Dynamic Sources
    If you’re using Online Store 2.0, metafields can also be used as a Dynamic Source in your theme editor.
    So when you define a metafield like pairing_group = 3/8 zinc, you can connect it to a “Related Products” section and have it automatically show everything with the same metafield value.

  4. :toolbox: App Suggestion (Optional)

    • Search & Discovery (Shopify App by Shopify) – lets you use metafields to define related products dynamically.

    • Exilant’s “Related Products & Upsell” – supports automatic grouping by tags/metafields, perfect for bulk catalogs.

This setup will let you simply add one tag or metafield while creating the product, and the “Pairs With” section will populate itself automatically.


:hammer_and_wrench: You can check out our Shopify Partner profile — we’ve built and shared several free Shopify app solutions to help store owners. Feel free to explore our profile and see how our apps can make your Shopify experience better!

1 Like

Thank you for this info! Regarding your option 3 using dynamic metafields. I do have a 2.0 theme and a product grid in my template that I could add to the product page. But maybe I didn’t do it right, it seems like it was only going to display the same products on every product page.

So would I go create a product metafield, then when creating the product I use 3/8 zinc….and each product that I apply 3/8 zinc too should show up in the grid for that product….and every product should show different “pairs with” items based on the metafield datas entered? It didnt seem like it was working right.

The other issue I can see with metafield is that I don’t have the ability to remove any. For instance, on the 3/8 bolt, we will have it in many lengths and they will all have 3/8 zinc and I will want the 3/8 zinc nuts and washers to show up on every 3/8 bolts page for all the lengths…..BUT I don’t want all the different bolt lengths showing up on each others pages, I only want the nuts and washers. Could I do something like add multiple data in the bolts metafield like 3/8zinc nut, 3/8zinc washers so that it only showed up nuts and washers and not the other bolts?

It SEEMS like I would need two different metafields, one to label to product and one to show what displays on the product page. Like in this case, I need to label the bold with “3/8zinc bolt” so that I can have it show up on other product pages like for the nut and washers product pages. BUT I need a second field to tell it that I want 3/8zinc nut and 3/8zinc washer to show up on the bolts product page. But is it possible to make this happen or am I thinking about it all wrong? Would I do it by creating a metaobject that has both fields associated with it??? This is my first time really using a 2.0 theme with metadata so I’m just trying to figure it out.

ALSO, I do have the Search and Discovery app and a block for recommended items….but it seems like its either all manual, or if used with a metafield that it puts the same products all over. It didn’t seem like I could easily add tag type data into a metafield to get different items paired with different products. BUT I might have been doing it wrong?

I’m sorry I have typed so much! Its hard to explain. Thank You for your help so far!

It’s LLM/chatgpt generated text so your gonna get misled into getting confused and having problems basing your actions on it because of how wrong it is while looking correct to non-experts;
; like the collection.all with where filter for tags thing just doesn’t work like that at all it’s syntactically correct but it’s operational gibberish for what you need.

Simplest approach could be a product-list metafield reference, or a metaobject to be reusable across products. note metaobjects also have an optional webpages feature to keep in mind
Then to fill in the product values without less manual data-entry use a bulk-editor app, metafield app, or spreadsheet app
Or create automations with an automation app like mechanic with a custom script or theoretically even shopify-flow to parse tags into specific mappings/relations. No exact unicorn task for this just library samples of capability e.g. https://tasks.mechanic.dev/copy-prefixed-tags-to-metafields

To use a product-list as a dynamic source might not be possible in all themes, and could require advanced theme customizations to get the actual desired results.

Going it alone in information architecture is a good way to burn a ton of time and money.
Reach out to me if you need actual consulting, customizations or automations to get this done (:speaking_head: :email: click profile pic in forums for options)

2 Likes

Hi @stephenw ,
You’re absolutely right that manually assigning “pairs with” or “frequently bought together” products isn’t scalable. The good news is you can automate this using product tags or metafields - no need to create thousands of collections.

Here’s how you can set it up:


Use Tags to Auto-Link Related Products

  1. When creating products, give related products a shared tag (e.g. 3-8-zinc).
  • Example:
    • 3/8 zinc bolt → Tag: 3-8-zinc
    • 3/8 zinc nut → Tag: 3-8-zinc
    • 3/8 zinc washer → Tag: 3-8-zinc
  1. Then, in your product template, add a “Pairs With” section that automatically pulls in other products sharing the same tag:
{% assign shared_tag = product.tags | first %}
{% assign related_products = collections.all.products | where: "tags", shared_tag %}

<div class="pairs-with">
  <h3>Pairs Well With</h3>
  <div class="grid">
    {% for related_product in related_products %}
      {% unless related_product.id == product.id %}
        <a href="{{ related_product.url }}">
          <img src="{{ related_product.featured_image | img_url: 'medium' }}" alt="{{ related_product.title }}">
          <p>{{ related_product.title }}</p>
        </a>
      {% endunless %}
    {% endfor %}
  </div>
</div>
1 Like

This would only inspect first 50 products of collection “all”.
Means would not work for a store with thousands of items.

Using storefront API with Javascript would be a better option.

2 Likes

@tim_1 ,

Agreed but can increase the limit using js and using liquid as second option :slight_smile: .

1 Like
  • The maximum Liquid page size has been increased from 50 to 250 to match the Storefront GraphQL API limit.

So you’d need to use paginate then and it will be at most 250 products.
No go in my opinion.

2 Likes

Can you expand a bit on your thoughts regarding “storefront api with JavaScript”? Is that building a completely custom “Pairs With” section that used the storefront api to check metafield data to know what products to pair up?

That sounds way over my head lol. I’d have to have it built but it sounds pretty expensive, id guess it’s probably outside of my budget.

I really didn’t think it would be so hard to come up with something good, I figured there would be a way to do it with built in functions or at least an app. I can’t believe there aren’t some good apps for this.

What I am saying is:

You may tag your related products with 3-8-zync, however, it’s not that easy to fetch all products in your store which possess this tag from the liquid code due to restrictions I’ve mentioned above.

But this is pretty easy and fast with JS code and Storefront API.
For example – Lot x2 - 2000 Bowman & Topps Adrian Gonzalez Rookie RC – BBK Market
The code dynamically fetches all products which has the same first part of the title (before -). ( may look ugly – it’s just a playground).

And you’d need to use custom code anyway, unless you decide to create those “related collections” which can be assigned as a metafield and then fed via Dynamic source to a “Featured collection” section.

However, it’s hard to suggest best way without better understanding of your products, their relationships and quantities. Also, one have to take in account Shopify limits on number of collections and similar.

Obviously a lot can be automated, but you’d need a good strategy on assigning the data these automations can run from.

Very crude example:


Say, for each product you have a type property and “addons” metafield, which has a type of products to compliment this product.

Then have is a Flow, which loops over products, and for each product

  1. reads “addons”
  2. gets all products which has type == addons value
  3. and populates a “recommended_addons” metafield on the initial product with this list.

Custom Liquid code can read these products from the “recommended_addons” and render them on the product page.

Alternatively, the code can create a collection, say “recommended-for-type”, populate it with products and put it’s reference into original products MF.
Then this collection reference MF can be fed to “Featured collection” section on product page.


But again, to recommend, one needs to understand your products.


Finally, do not forget, that "Recommended products" and "Complimentary products" are self-learning and after some purchases they will learn that people tend to buy 3-8-zync nuts together with 3-8-zync bolts.

So you may try to focus on something else and see if it does what you want automatically.
Maybe pay attention to this in your product description to help the logic.

And then revisit this functionality when you have either budget or knowledge.

2 Likes

Thank you for that info! I think I’m going to break down and try to do this using smart collections that are based on metafields, it seems like the best way for a nonprogrammer such as myself thats trying to make something good happen without having much money to spend. I think I would make a Metafield like size/finish and put in say 3/8zinc. Then I could get all the 3/8 zinc items to show up in a collection on the product page. BUT….how would I get different products to automatically show up different pairs will collection groupings? It seems like the collection grid only points to one dynamic source so wouldnt it just always show the same products???

Trap that’s fatal to beginners businesses.
If it was so easy everyone would be doing the best thing or better and you could NEVER compete.
Proper investment of money and TIME is how business that survive differentiate themselves.

Still overcomplicating this, collection can be overkill with scaling problems unless you handmake collections of under 50 products to match a specific product or set-of-products:

Start simple give some products specific short list of products to get to a manual prototype then work up.
Even the “ai” sidekick should be able to make a section grid of products from a product-list reference, or a collection grid but it’s gonna have a hard time with matchmaking business logic.

You wouldn’t build a house or car like this from the parts you sell.., jacks first, then frame, then struts, etc.