SapotaCorp

Product sourcing on Shopify: metaobject for origin data

An olive oil merchant wants every product's page to show the specific farm it's sourced from - farm name, location, sustainability practices. Hard-coding per product doesn't scale and per-product metafields duplicate data. Metaobjects are the fit.

Product sourcing on Shopify: metaobject for origin data

Key takeaways

  • Origin and sourcing story data (farm name, location, sustainability practices, artisan profile) is the canonical metaobject use case. Multiple products share the same source; each product page shows the source story; updates to the source propagate to every product automatically.
  • Modeling pattern: one metaobject per source entity (Farm, Artisan, Mill, Distillery). Schema includes name, location (string + map coordinates), story text, certifications, photo gallery. Products reference their source via metaobject reference field.
  • Theme rendering pulls source data via Liquid: access the metaobject reference, render the fields with appropriate layout. The pattern keeps source storytelling consistent across product pages without per-product HTML duplication.
  • Sustainability and provenance trends drive the pattern's adoption. Customers increasingly want to know where products come from; metaobjects make the storytelling scalable. Brands that adopt the pattern can update their sustainability narrative once and have it propagate to every product.

A specialty food merchant wants every product's page to show where it's sourced from. For an olive oil line, that's the specific olive grove - farm name, location, sustainability practices, maybe a photo of the farm. Customers care about provenance; the brand story depends on surfacing this data cleanly.

The merchant's 40 products come from 8 different farms. Some farms supply multiple products; some supply just one. How do you model this so the data stays consistent and editable?

The approaches that fall apart

Hard-code the farm info in theme sections per product. Requires a developer to edit theme code for every product addition or farm change. Works for a stable catalog; fails the moment the merchant wants to add a new product or update a farm's certification status.

Per-product metafield for farm name, location, etc. Works. But 40 products × 8 farms means farm data is typed multiple times. When the Laurel Grove farm gets new sustainability certification, the merchant updates 5 products individually. Inconsistency creeps in (one product says "organic farming" while another says "Organic farming").

Separate products for each farm's items with farm info in the product description. Conflates "what's this farm like" with "what's this product" - makes cross-farm filtering impossible and bloats every product description.

The fit: metaobject for farm, referenced from products

A metaobject definition farm with fields matching the data the merchant wants to surface:

  • name - single-line text
  • location - single-line text
  • sustainability_practices - list of single-line text (for bullet points)
  • photo - file reference (image of the farm)
  • year_established - integer
  • certifications - list of single-line text

Create one metaobject entry per farm. The merchant enters Laurel Grove's data once; the 5 products sourced from it all reference the same entry.

Each product gets a metafield farm_ref that references the relevant farm metaobject.

Rendering on the product page

In Liquid, the product template fetches the referenced farm and displays its fields:

{% if product.metafields.custom.farm_ref %}
  {% assign farm = product.metafields.custom.farm_ref.value %}
  <section class="sourcing-story">
    <h3>Sourced from:</h3>
    <h4>{{ farm.name }}</h4>
    <p>{{ farm.location }}</p>

    {% if farm.photo %}
      <img src="{{ farm.photo | image_url: width: 600 }}"
           alt="{{ farm.name }}"
           loading="lazy" />
    {% endif %}

    <h5>Sustainability practices:</h5>
    <ul>
      {% for practice in farm.sustainability_practices.value %}
        <li>{{ practice }}</li>
      {% endfor %}
    </ul>

    {% if farm.certifications.value.size > 0 %}
      <p>Certifications: {{ farm.certifications.value | join: ", " }}</p>
    {% endif %}
  </section>
{% endif %}

The same markup serves every product. Variation lives in the data, not the template.

Why this scales

Edit once, propagate everywhere. Laurel Grove gets a new certification → merchant updates the farm metaobject entry once → all 5 Laurel Grove products display the updated info immediately.

Merchant workflow fits. Content managers manage farms from the Content → Metaobjects admin section - a tidy list of all 8 farms, not buried in product admin.

Storefront performance is good. Metaobject references resolve at theme-render time without extra API calls; the data comes through Shopify's product API like any metafield.

Filtering and search become possible. Metaobject fields can be referenced in product filters - "show me all products sourced from California farms" becomes possible via the farm's location field.

Related patterns

The same model applies to:

  • Artisan profiles for handmade goods (artisan name, bio, studio location, specialty)
  • Winery profiles for a wine merchant (winery name, region, tasting notes style, awards)
  • Supplier profiles for B2B distribution (supplier, lead times, MOQ, contact)
  • Collection/capsule descriptions for fashion (season, designer notes, inspiration story)

Any data that represents a named, structured entity with its own independent life cycle.

Content migration

Merchants starting from per-product metafields can migrate:

  1. Define the farm metaobject
  2. Script via Admin API to find unique farm values across products
  3. Create farm metaobject entries
  4. Update product metafields to reference the right farm entry
  5. Remove the obsolete per-product text metafields

The migration preserves all data but replaces duplication with references.

What ships with this pattern

A sourcing-story implementation ready for production has:

  • Farm metaobject definition matching the data the brand wants to tell
  • Metaobject entries for each real farm or artisan
  • Product metafields referencing the relevant entry
  • Theme section rendering the referenced data
  • Admin UX where merchants maintain farms independently of products
  • SEO markup (structured data / JSON-LD) populated from the farm data for rich results

Metaobjects turn provenance into something editable, reusable, and presentable. That's exactly where merchants selling story-driven products need to land.

Engineering certifications

Sapota engineers hold credentials on Shopify. Each badge links to the individual engineer's credly profile.

Browse Shopify certs

Need this on your team?

Sapota engineers ship the patterns you read here. Two-week paid trial, direct pricing from $1,800/ engineer/month, no agency markup.

Get a quote
Contact Us Now

Share Your Story

We build trust by delivering what we promise – the first time and every time!

We'd love to hear your vision. Our IT experts will reach out to you during business hours to discuss making it happen.

WHY CHOOSE US

"Collaborate, Elevate, Celebrate where Associates - Create Project Excellence"

SapotaCorp beyond the IT industry standard, we are

  • Certificated
  • Assured quality
  • Extra maintenance

Tell us about your project