{% comment %}
Use page name from Custo if it's been customized, otherwise use the localized default.
{% endcomment %}
{% assign page_title = t['navigation.products'] %}
{% if page.full_url contains "search=" %}
{% assign page_title = t['products.search_results'] %}
{% elsif page.name != 'Products' %}
{% assign page_title = page.name %}
{% endif %}
{% paginate products from products.current by theme.products_per_page %}
{% if products != blank %}
{% if paginate.pages > 1 %}
{% if paginate.previous.is_link %}
{{ t['navigation.previous'] }}
{% else %}
{{ t['navigation.previous'] }}
{% endif %}
{{ paginate | default_pagination, 'page-numbers', 'page-numbers' }}
{% if paginate.next.is_link %}
{{ t['navigation.next'] }}
{% else %}
{% endif %}
{% endif %}
{% else %}
{% endif %}
{% endpaginate %}
{{ page_title }}
- {{ t['navigation.all'] }} {% for category in categories.active %}
- {{ category | link_to }} {% endfor %}
{% 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 status_class %}{% if product.status == 'active' and product.on_sale %}status-primary{% else %}status-secondary{% endif %}{% endcapture %}
{% endfor %}