Hello @Rich152
To achieve functionality similar to an ACF repeater in Shopify—allowing for multiple entries of two fields (text + product link) per product—you can use Shopify’s Metafields with a definition of a list of objects.
Here’s how you can create a custom metafield definition and use it in your theme:
- Define a Custom Product Metafield in Admin
Go to your Shopify admin:
. Settings → Custom data → Products → Add definition
. Name: e.g., Related Items
. Namespace and key: custom.related_items
. Content type: List of Objects
. Add the following fields to the object:
. Text field (label: Label, type: single-line text)
. Product field (label: Product Link, type: product reference)
Make sure the definition is visible in the product admin so it can be filled per product.
- Example of JSON Structure Behind the Scenes
Once populated, the metafield might look like this in Liquid:
[
{
"label": "Goes well with Freedom Shorts",
"product": {
"id": 123456789,
"handle": "freedom-shorts"
}
},
{
"label": "Perfect with Selena Leggings",
"product": {
"id": 987654321,
"handle": "selena-leggings"
}
}
]
- How to Render This in Liquid (Product Page)
In your product.liquid or section file like main-product.liquid, insert:
{% if product.metafields.custom.related_items != blank %}
#### Related Items
{% for item in product.metafields.custom.related_items %}
- **{{ item.label }}**
{{ item.product.title }}
{% endfor %}
{% endif %}
Tips
. This is native and scalable—doesn’t require apps or third-party tools.
. You can style it with CSS, or place the block wherever appropriate in your layout.
. If you’re using Shopify’s Online Store 2.0, you can create a custom Liquid block in a section and let merchants move it around.
Thank you 