Last active
November 10, 2022 00:06
-
-
Save jimmijazz/3a63da568e6a8402f93527e25eeecf78 to your computer and use it in GitHub Desktop.
Add to Cart Prompt Message (Jake)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- 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