首先寻找一种方法来选择某些现有产品,以便在Shopify中将标题,图像,描述放在另一个页面上(甚至在另一个产品页面中 - 因为某些产品被组合成其他产品).
下面的方法是我在Shopify中创建数组时遇到的唯一方法.(分裂方法).
等式的下一部分是使用{{myArray}}中的值来选择匹配的var,然后吐出存储在该数组中的不同值.
但是,我的尝试不起作用.有没有办法将键添加到其他数组(即p1,p2,p3数组),以便在for循环期间更容易选择它们?
{% assign myArray = "p1|p3" | split: "|" %}
{% assign p1 = "Product One|product-one|This is my description of product one, and it must be a single paragraphy without any html formatting. The length is not an issue.|product_one_image.jpg" | split:"|" %}
{% assign p2 = "Product Two|product-two|This is my description of product two, and it must be a single paragraphy without any html formatting.|product_two_image.jpg" | split:"|" %}
{% assign p3 = "Product Three|product-three|This is …Run Code Online (Sandbox Code Playgroud)