Ich habe 8 Feature-Produkte in meiner settings_schema.json hinzugefügt. Ich möchte, dass sie durch for-Schleife zur Ausgabe von Nummer am Ende des settings.feature_product Zugabe [aufsteigende Integer]Unescaping Schnur? in Shopify
Dies ist meine Einstellungen Schema
{
"type": "product",
"id": "feature_product1",
"label": "Feature Product 1"
},
{
"type": "product",
"id": "feature_product2",
"label": "Feature Product 2"
},
{
"type": "product",
"id": "feature_product3",
"label": "Feature Product 3"
},
{
"type": "product",
"id": "feature_product4",
"label": "Feature Product 4"
},
{
"type": "product",
"id": "feature_product5",
"label": "Feature Product 5"
},
{
"type": "product",
"id": "feature_product6",
"label": "Feature Product 6"
},
{
"type": "product",
"id": "feature_product7",
"label": "Feature Product 7"
},
{
"type": "product",
"id": "feature_product8",
"label": "Feature Product 8"
}
Dies ist der Code in meinem Schnipsel ist
{% for i in (1..8) %}
{% if i <= 8 %}
<div class="case_item">
{% assign case_var = 'settings.feature_product' | append: i | strip_html %}
{{ all_products[case_var].title }}
</div>
{% endif %}
{% endfor %}
Aber es funktioniert nicht :(ich habe versucht, die case_var und das Ergebnis ist .. settings.feature_product1 settings.feature_product2 . zu drucken. settings.feature_product3
Kann mir jemand helfen?
Vielen Dank! Es funktioniert cool & heiß! –