Hi everyone ![]()
I’m trying to build a lightweight colour-swatch picker that links together separate products (we don’t want to use variants).
(Ex-Boyfriend® Valentín Long – HAND OVER)
I added two product-level metafields:
| Namespace / Key | Type | Example value |
|---|---|---|
| custom.color_swatch | Single-line text (hex) | #FFFFFF |
| custom.related_product_group | Product (List) | White Guayabera Shirt, Light Blue Guayabera Shirt |
Both metafields are set to Storefront access: Visible.
Snippet:
snippets/color-siblings.liquid
{% comment %} product is in scope when using {% render %} {% endcomment %}
{% assign product_siblings = product.metafields.custom.related_product_group.value %}
{% if product_siblings[1] %}
<div class="sibling-swatches-container">
<p class="sibling-swatches-title">Color:</p>
<div class="sibling-swatches">
{% for sibling in product_siblings %}
{% assign swatch_color = sibling.metafields.custom.color_swatch.value %}
{% if swatch_color %}
<a
href="{{ sibling.url }}"
class="sibling-swatch {% if sibling.id == product.id %}current{% endif %}"
aria-label="View {{ sibling.title }}"
>
<span
class="swatch-color-indicator"
style="background-color: {{ swatch_color }};"
></span>
</a>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
In the product template I simply add a Custom Liquid block with:
{% render 'color-siblings' %}
The problem
Nothing at all is rendered on the storefront no markup, no errors in the console, and no Liquid errors in the theme editor. The metafields themselves are definitely populated (I can output {{ product.metafields.custom.color_swatch }} elsewhere).
What I’m trying to find out
- Is my approach to accessing a List → Product metafield inside a snippet correct?
- Does the .value accessor work for product lists in snippets rendered in the editor?
- Could this be a scope issue (e.g., need to preload the referenced products with all_products or similar)?
- Any other pitfalls I’m missing that would cause the loop simply not to run?
Extras
- Theme: CREATIVE
- Screenshots of metafield setup and template placement attached.
I’d really appreciate any pointers or if someone has a cleaner pattern for sibling-product colour swatches, I’m open to alternatives. Thanks a lot!
TL;DR: Custom snippet reading a product-list metafield isn’t outputting anything on the product page; need help figuring out why.



