test

选择目的地国家/地区

{% comment %} 提取所有非空国家值 {% endcomment %} {% assign countries = "" | split: "," %} {% for product in collections.all.products %} {% assign country = product.metafields.custom.country.value %} {% if country and country != blank %} {% unless countries contains country %} {% assign countries = countries | push: country %} {% endunless %} {% endif %} {% endfor %} {% comment %} 按字母排序 {% endcomment %} {% assign sorted_countries = countries | sort %} {% comment %} 动态生成国家卡片 {% endcomment %} {% for country in sorted_countries %} {% case country %} {% when '中国' %}🇨🇳 {% when '美国' %}🇺🇸 {% when '日本' %}🇯🇵 {% when '韩国' %}🇰🇷 {% when '泰国' %}🇹🇭 {% when '英国' %}🇬🇧 {% when '法国' %}🇫🇷 {% when '德国' %}🇩🇪 {% when '澳大利亚' %}🇦🇺 {% when '加拿大' %}🇨🇦 {% else %}🌍 {% endcase %} {{ country }} {% assign count = 0 %} {% for product in collections.all.products %} {% if product.metafields.custom.country.value == country %} {% assign count = count | plus: 1 %} {% endif %} {% endfor %} {{ count }}个套餐 {% endfor %}