【问题标题】:All products in a product_tag are not showing up on collection pageproduct_tag 中的所有产品均未显示在产品系列页面上
【发布时间】:2015-09-02 13:31:06
【问题描述】:

这个问题很奇怪——在一个集合页面上,我们按产品类型显示所有产品,该页面仅显示总数的 80% 左右。任何页面都没有限制,当我们点击到product_type页面时,所有产品都清晰可见。

这是我们现在使用的 .liquid 主题文件-

{% if collection.handle %}
  <!-- basic collection -->
  <!-- sorting by product type within collection (with titles) -->
  {% assign sorted_by_type = collection.all.products | sort: 'type' %}

  {% for product_type in collection.all_types %}
  <div class="products clearfix collection">
      {% assign the_type = product_type %}
      <h2>{{ the_type | link_to_type }}</h2>
      {% paginate collections.all.products by 2000 %}
        {% for product in collections.all.products %}
          {% if product.type == the_type %}
            {% include 'product-loop' %}
          {% endif %}
        {% endfor %}
      {% endpaginate %}
  </div>
  {% endfor %}

{% else %}
  <!-- vendor -->
  {% assign image_name = collection.title | handleize | append: '.jpg' %}
  <div class="banner my-backstretch" data-vendorname="{{ collection.title | handleize }}" data-src="{{ image_name | asset_url }}"></div>

  <!-- sorting by product type within vendor (with titles) -->
  {% assign sorted_by_type = collection.products | sort: 'type' %}

  {% for product_type in collection.all_types %}
  <div class="products clearfix collection">
      {% assign the_type = product_type %}
      <h2>{{ the_type | link_to_type }}</h2>
      {% paginate collection.products by 2000 %}
        {% for product in collection.products %}
          {% if product.type == the_type %}
        {% include 'product-loop' %}
          {% endif %}
        {% endfor %}
      {% endpaginate %}
  </div>
  {% endfor %}
{% endif %}

任何帮助或帮助查明此错误都会很棒!对 Shopify 还不是很熟悉。

【问题讨论】:

    标签: shopify


    【解决方案1】:

    即使您告诉它按 2000 个产品分页,您仍然会被限制为 50 个。

    See here in the Shopify docs 了解更多信息:

    {% paginate collection.products by 9 %}
    

    在上面的示例中,数字是 9,但在您的主题中,该数字可以是 6 或 12,或者小于或等于 50 的任何其他数字。此数字对应于每页展示的产品数量。

    编辑该数字以增加或减少每页显示的产品数量。 分页数不要超过 50

    【讨论】:

      猜你喜欢
      • 2014-12-26
      • 2017-06-14
      • 1970-01-01
      • 2012-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多