Liquid Shopify - 在自定义登陆页面上显示特定产品
Liquid Shopify - Display specific products on custom landing page
是否可以编写一个循环,在其中我可以在自定义 liquid 着陆页(例如,文件名 templates\page.[page-title].liquid
)上显示属于不同系列的特定产品?
这是我的循环示例:
<div id="recommended-products">
<!-- Begin loop with specific products (Perhaps by id?) -->
<div class="product-card">
<div class="product-card__title">{{ product.title | escape }}</div>
<div class="product-card__price">
{% if product.price_varies %}
{{ product.price_min | money }} - {{ product.price_max | money }}
{% else %}
{{ product.price | money }}
{% endif %}
</div>
</div>
<!-- End loop -->
</div>
感谢您的宝贵时间。
Shopify Select 任何产品块代码
{%- for block in section.blocks -%}
{%- assign product = block.settings.product -%}
<img src="{{ product.featured_image | img_url: 'master' }}">
<div class="Product_detail">
{{ product.title | escape }}
{% render 'price', product: product, price_class: '' %}
</div>
{%- endfor -%}
{% schema %}
{
"name": "product",
"settings": [],
"blocks": [
{
"type": "Product",
"name": "Product block",
"settings": [
{
"type": "product",
"id": "product",
"label": "t:sections.featured-product.settings.product.label"
}
]
}
],
"presets": [
{
"name": "products"
}
]
}
{% endschema %}
是否可以编写一个循环,在其中我可以在自定义 liquid 着陆页(例如,文件名 templates\page.[page-title].liquid
)上显示属于不同系列的特定产品?
这是我的循环示例:
<div id="recommended-products">
<!-- Begin loop with specific products (Perhaps by id?) -->
<div class="product-card">
<div class="product-card__title">{{ product.title | escape }}</div>
<div class="product-card__price">
{% if product.price_varies %}
{{ product.price_min | money }} - {{ product.price_max | money }}
{% else %}
{{ product.price | money }}
{% endif %}
</div>
</div>
<!-- End loop -->
</div>
感谢您的宝贵时间。
Shopify Select 任何产品块代码
{%- for block in section.blocks -%}
{%- assign product = block.settings.product -%}
<img src="{{ product.featured_image | img_url: 'master' }}">
<div class="Product_detail">
{{ product.title | escape }}
{% render 'price', product: product, price_class: '' %}
</div>
{%- endfor -%}
{% schema %}
{
"name": "product",
"settings": [],
"blocks": [
{
"type": "Product",
"name": "Product block",
"settings": [
{
"type": "product",
"id": "product",
"label": "t:sections.featured-product.settings.product.label"
}
]
}
],
"presets": [
{
"name": "products"
}
]
}
{% endschema %}