{% if page.full_url contains "search=" or theme.collections != true or page.full_url contains '/category' %}
{% paginate products from products.current by theme.products_per_page %}
{% if products != blank %}
{% for product in products %}
{% assign image_width = product.image.width | times: 1.0 %}
{% assign image_height = product.image.height | times: 1.0 %}
{% assign aspect_ratio = image_width | divided_by: image_height %}
{% assign product_status = '' %}
{% case product.status %}
{% when 'active' %}
{% if product.on_sale %}
{% assign product_status = t['products.on_sale'] %}
{% endif %}
{% when 'sold-out' %}
{% assign product_status = t['products.sold_out'] %}
{% when 'coming-soon' %}
{% assign product_status = t['products.coming_soon'] %}
{% endcase %}
{% capture image_class %}
{% if product.image.height > product.image.width %}
image-tall
{% elsif product.image.height < product.image.width %}
image-wide
{% else %}
image-square
{% endif %}
{% endcapture %}
{% capture product-status-class %}{% if product.status == 'active' and product.on_sale %}status-primary{% else %}status-secondary{% endif %}{% endcapture %}
{% endfor %}
{% if paginate.pages > 1 %}
{% endif %}
{% else %}
{{ t['products.no_products'] }}
{% endif %}
{% endpaginate %}
{% else %}
{% if categories.active != blank %}
{% else %}
{{ t['products.no_products'] }}
{% endif %}
{% endif %}