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 %}
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024