{% 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 %} {% assign pageQuerystring = page.full_url | split:'sort=' | last %} {% assign pageURL = page.full_url | split:'?' | first %} {% if pageQuerystring contains 'on_sale' %} {% assign sort_order = 'on_sale' %} {% assign sort_order_name = t['navigation.sort_by_on_sale'] %} {% elsif pageQuerystring contains 'sales' %} {% assign sort_order = 'sales' %} {% assign sort_order_name = t['navigation.sort_by_top_selling'] %} {% elsif pageQuerystring contains 'name_a_to_z' %} {% assign sort_order = 'name_a_to_z' %} {% assign sort_order_name = t['navigation.sort_by_alphabetically_a_to_z'] %} {% elsif pageQuerystring contains 'name_z_to_a' %} {% assign sort_order = 'name_z_to_a' %} {% assign sort_order_name = t['navigation.sort_by_alphabetically_z_to_a'] %} {% elsif pageQuerystring contains 'date_new_to_old' %} {% assign sort_order = 'date_new_to_old' %} {% assign sort_order_name = t['navigation.sort_by_date_new_to_old'] %} {% elsif pageQuerystring contains 'date_old_to_new' %} {% assign sort_order = 'date_old_to_new' %} {% assign sort_order_name = t['navigation.sort_by_date_old_to_new'] %} {% elsif pageQuerystring contains 'price_low_to_high' %} {% assign sort_order = 'price_low_to_high' %} {% assign sort_order_name = t['navigation.sort_by_price_low_to_high'] %} {% elsif pageQuerystring contains 'price_high_to_low' %} {% assign sort_order = 'price_high_to_low' %} {% assign sort_order_name = t['navigation.sort_by_price_high_to_low'] %} {% else %} {% assign sort_order = '' %} {% assign sort_order_name = t['navigation.sort_by_featured'] %} {% endif %} {% paginate products from products.current by theme.products_per_page order: sort_order %} {% 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 status_classes %}{{ theme.product_badge_style }} {% if product.status == 'active' and product.on_sale %}status-primary{% else %}status-secondary{% endif %}{% endcapture %}
{% if product_status != blank and theme.product_badge_style != 'inline' %}
{{ product_status }}
{% endif %} {% if theme.show_quickview %}
{{ t['navigation.quick_view'] }}
{% endif %}
{{ product.name }}
{% assign hide_price = false %} {% if product.status == 'sold-out' and theme.show_sold_out_product_prices == false %} {% assign hide_price = true %} {% endif -%} {% if product.status == 'coming-soon' and theme.show_coming_soon_product_prices == false %} {% assign hide_price = true %} {% endif %} {% if product.has_password_protection and theme.show_password_protected_product_prices == false %} {% assign hide_price = true %} {% endif %} {% unless hide_price %} {{ product | product_price: theme.money_format, theme.product_variable_pricing_display_format }} {% if product.price_suffix != blank %} {% assign variable_price_shown = true %} {% if theme.product_variable_pricing_display_format == "min_only" or theme.product_variable_pricing_display_format == "max_only" %} {% assign variable_price_shown = false %} {% endif %} {% if product.variable_pricing and variable_price_shown %} {% assign formatted_suffix = '(' | append: product.price_suffix | append: ')' %} {% else %} {% assign formatted_suffix = product.price_suffix %} {% endif %} {{ formatted_suffix }} {% endif %} {% endunless %}
{% unless hide_price %} {% if product.options.size > 1 and theme.show_product_variant_count_in_grid %}
{{ product.options.size }} {{ t['products.variants'] }}
{% endif %} {% endunless %} {% if product_status != blank and theme.product_badge_style == 'inline' %}
{{ product_status }}
{% endif %} {% if theme.show_quickview and theme.mobile_product_grid_style == 'horizontal' %}
{{ t['navigation.quick_view'] }}
{% endif %}
{% endfor %}
{% if paginate.pages > 1 %} {% endif %} {% else %}
{{ t['products.no_products'] }}
{% endif %} {% endpaginate %}