{% comment %} Renders a list of product's variants Accepts: - product: {Object} Product Liquid object - show_image: {Boolean} Shows image of the variant in the row - is_modal: {Boolean} Defines if this snippet lives in a modal (optional) Usage: {% render 'quick-order-list', product: product %} {% endcomment %} {% comment %} TODO: enable theme-check once `line_items_for` is accepted as valid filter {% endcomment %} {% # theme-check-disable %} {%- assign items_in_cart = cart | line_items_for: product | sum: 'quantity' -%} {% # theme-check-enable %}
{% paginate product.variants by section.settings.variants_per_page %}
{%- if product.has_only_default_variant -%} {%- render 'quick-order-list-row', item: product, image: product.featured_media, sku: product.selected_or_first_available_variant.sku, variant: product.selected_or_first_available_variant, show_image: show_image, show_sku: show_sku, is_modal: is_modal -%} {%- else -%} {%- for variant in product.variants -%} {%- render 'quick-order-list-row', item: variant, image: variant.image, sku: variant.sku, variant: variant, show_image: show_image, show_sku: show_sku, is_modal: is_modal -%} {%- endfor -%} {%- endif -%}
{{ 'sections.cart.title' | t }}
{%- if product.has_only_default_variant -%} {{ 'sections.quick_order_list.product' | t }} {%- else -%} {{ 'sections.quick_order_list.variant' | t }} {%- endif -%} {%- if product.has_only_default_variant -%} {{ 'sections.quick_order_list.product_total' | t }} {%- else -%} {{ 'sections.quick_order_list.variant_total' | t }} {%- endif -%} {{ 'products.product.quantity.label' | t }} {{ 'sections.cart.headings.price' | t }} {%- if product.has_only_default_variant -%} {{ 'sections.quick_order_list.product_total' | t }} {%- else -%} {{ 'sections.quick_order_list.variant_total' | t }} {%- endif -%}
{% render 'pagination', paginate: paginate %}
{%- endpaginate -%}

{%- if product.has_only_default_variant or product.variants_count == 1 -%} {% comment %} Populated by JS {% endcomment %} {%- else -%}
{{- 'sections.quick_order_list.view_cart' | t -}}
{%- render 'loading-spinner' -%}
{% comment %} Populated by JS {% endcomment %}
{{ items_in_cart }}

{{ 'sections.quick_order_list.total_items' | t }}

{% comment %} TODO: enable theme-check once `line_items_for` is accepted as valid filter {% endcomment %} {% # theme-check-disable %} {{ cart | line_items_for: product | sum: 'original_line_price' | money }} {% # theme-check-enable %}

{{ 'sections.quick_order_list.product_total' | t }}

{%- if cart.duties_included and cart.taxes_included -%} {%- if shop.shipping_policy.body == blank -%} {{ 'sections.cart.duties_and_taxes_included_shipping_at_checkout_without_policy' | t }} {%- else -%} {{ 'sections.cart.duties_and_taxes_included_shipping_at_checkout_with_policy_html' | t: link: shop.shipping_policy.url }} {%- endif -%} {%- elsif cart.duties_included == false and cart.taxes_included -%} {%- if shop.shipping_policy.body == blank -%} {{ 'sections.cart.taxes_included_shipping_at_checkout_without_policy' | t }} {%- else -%} {{ 'sections.cart.taxes_included_shipping_at_checkout_with_policy_html' | t: link: shop.shipping_policy.url }} {%- endif -%} {%- elsif cart.duties_included and cart.taxes_included == false -%} {%- if shop.shipping_policy.body == blank -%} {{ 'sections.cart.duties_included_taxes_at_checkout_shipping_at_checkout_without_policy' | t }} {%- else -%} {{ 'sections.cart.duties_included_taxes_at_checkout_shipping_at_checkout_with_policy_html' | t: link: shop.shipping_policy.url }} {%- endif -%} {%- elsif cart.duties_included == false and cart.taxes_included == false -%} {%- if shop.shipping_policy.body == blank -%} {{ 'sections.cart.taxes_at_checkout_shipping_at_checkout_without_policy' | t }} {%- else -%} {{ 'sections.cart.taxes_at_checkout_shipping_at_checkout_with_policy_html' | t: link: shop.shipping_policy.url }} {%- endif -%} {%- endif -%}
{{- 'sections.quick_order_list.view_cart' | t -}}
{%- render 'loading-spinner' -%}
{% comment %} Populated by JS {% endcomment %}
{%- endif -%}