create array of products using split

adialon
New Member
1 0 0

Hi,

I'm trying to iterate over some pre-chosen items with:

{% for product in relatedProducts limit: product_limit %}

but I can't set up the array "relatedProducts":

{% assign relatedProducts = {{settings.related_product_1}}|{{settings.related_product_2}}|{{settings.related_product_3}}|{{settings.related_product_4}} | split: "|" %}

error:

Liquid syntax error: Unexpected character { in "{{{{settings.related_product_1}}|{{settings.related_product_2}}|{{settings.related_product_3}}|{{settings.related_product_4}} | split: "|" }}"

 

It seems it works here:

https://community.shopify.com/c/Shopify-APIs-SDKs/How-to-loop-over-product-types-in-settings-schema-...

and Im not sure what I did wrong,

Any help would be very appreciated, Thank you.

0 Likes