我们如何更新或编辑每个产品的元字段以从 shopify 获取每个产品的多个图像?
If I understand your question you want to have multiple images per product and set in the metafields of the product which image corresponds to which feature of the product.
I would suggest the following, possibly using a web application or an app that removes any manual intervention:
product.media[product.metafields.myshop.media_data['front_picture']]
To make an example, let's say you have a product with 4 front and 5 back pictures.
{ "front" : [1,2,3,4],"back" : [5,6,7,8,9]}
(NB they don't have to be consequent numbers) {% for front_index in product.metafields.myshop.media_data.front %}
<img src="{{ product.media[front_index]| img_url: 'original' }}"/>
{% endfor %}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.