Skip to content

Instantly share code, notes, and snippets.

@jimmijazz
Last active November 10, 2022 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmijazz/3a63da568e6a8402f93527e25eeecf78 to your computer and use it in GitHub Desktop.
Save jimmijazz/3a63da568e6a8402f93527e25eeecf78 to your computer and use it in GitHub Desktop.
Add to Cart Prompt Message (Jake)
{%- assign has_bib = false -%}
{%- assign has_jersey = false -%}
{%- assign has_bundle = false -%}
{%- for item in cart.items -%}
{% if item.product.type == 'Bib' -%}
{%- assign has_bib = true -%}
{%- elsif item.product.type == 'Jersey' -%}
{%- assign has_jersey = true -%}
{%- endif -%}
{% endfor -%}
{%- if has_bib and has_jersey -%}
{%- assign has_bundle = true -%}
{%- endif -%}
{%- unless has_bundle -%}
{%- if has_bib or has_jersey -%}
// Show a message
{%- endif -%}
{%- endunless -%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment