0
我試圖展示Shopify允許每頁打電話的全部50個產品,但在我的搜索結果中僅顯示10個項目,並且分頁鏈接導致每頁的相同10個產品。Shopify search.liquid分頁破
我已閱讀文檔,甚至使用了Caroline Schnapp的骨架主題模板:https://github.com/Shopify/skeleton-theme/blob/master/templates/search.liquid,無論我嘗試什麼,我都可以得到相同的結果。
總之,我想在我的搜索結果頁面上顯示50個產品和分頁鏈接。
任何人都可以擺脫這一點嗎?
這裏是我的search.liquid
模板的內容:
{% paginate search.results by 50 %}
{% if search.results_count == 0 %}
<div class="search-noresults">
<h2 class="no-results">Nothing found for <span class="search-terms">{{ search.terms }}</span></h2>
<p class="search-again">try searching again</p>
</div>
{% else %}
<section class="search-grid clearfix">
<h2 class="results-for">Results for <span class="search-terms">{{ search.terms }}</span></h2>
{% for product in search.results %}
<section class="collection-grid ">
<div class="product-box" href="{{product.url}}">
<a href="{{product.url}}" class="ajaxify-link"><img src="{{ product.featured_image | product_img_url: 'large'}}" alt="{{ product.description | strip_html | truncate: 75 }} click for more information" /></a>
<hr class="collection-hr"><span class="grid-title">{{product.title}}</span><br/><span class="grid-price">{{ product.price | divided_by: 100 | replace: '.',' ' | truncatewords: 1 | remove: '...' }} £</span>
</div>
</section>
{% endfor %}
</section>
{% if search.results_count > 50 %}
<div id="pagination">
{{ paginate | default_pagination }}
</div>
{% endif %}
{% endif %}
{% endpaginate %}