Personalized checkout and custom promotions with Shopify Scripts
Hello,
I would like to display a table with products that have the same value in the metafield on the product detail. The code below should work, but unfortunately it doesn't. Do you know where the problem is?
{% assign current_product_value = product.metafields.custom.model_barva %}
{% assign related_products = all_products | where: 'metafields.custom.model_barva', current_product_value | where: 'handle', '!=', product.handle %}
{% if related_products.size > 0 %}
<table>
<thead>
<tr>
<th>Produkt</th>
<th>Cena</th>
</tr>
</thead>
<tbody>
{% for related_product in related_products %}
<tr>
<td><a href="{{ related_product.url }}">{{ related_product.title }}</a></td>
<td>{{ related_product.price | money }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025