21 lines
711 B
Plaintext
21 lines
711 B
Plaintext
{% layout none %}
|
|
{% comment %}
|
|
Product cards for the homepage best sellers slider.
|
|
Requested as /collections/{handle}?sort_by=best-selling&view=bestsellers-data
|
|
so Shopify returns the collection in best-selling order.
|
|
Page through enough products to fill the slider after sold-out items are skipped.
|
|
The section shows at most 12 cards.
|
|
{% endcomment %}
|
|
{% paginate collection.products by 50 %}
|
|
{% assign shown = 0 %}
|
|
{% for product in collection.products %}
|
|
{% if product.available %}
|
|
{% render 'bestsellers-card', product: product %}
|
|
{% assign shown = shown | plus: 1 %}
|
|
{% endif %}
|
|
{% if shown >= 12 %}
|
|
{% break %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endpaginate %}
|