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 %}
User | RANK |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023