Liquid Shopify-在自定义着陆页上显示特定产品

发布于 2025-01-31 19:49:55 字数 775 浏览 1 评论 0原文

是否可以编写一个循环,我可以在自定义液体着陆页面上显示属于不同集合的特定产品(例如,文件名模板\ 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>

谢谢您的宝贵时间。

Is it possible to write a loop where I can display specific products that belong to different collections on a custom liquid landing page (e.g., filename templates\page.[page-title].liquid)?

Here is an example of my loop:

<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>

Thank you for you time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难理解 2025-02-07 19:49:55

Shopify选择任何产品块代码

{%- 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 %}

Shopify Select Any Product Block Code

{%- 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 %}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文