Last active
November 1, 2020 19:00
-
-
Save richietyler/94aacb9ac9d093848ffdfc2bee5d25e8 to your computer and use it in GitHub Desktop.
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
{% for opt in product.options_with_values %} | |
{% if opt.name == 'Size' %} | |
{% for var in product.variants %} | |
{% if var.available %} | |
{% assign spanclass='size-label'%} | |
{% else %} | |
{% assign spanclass='size-label size-sold'%} | |
{% endif %} | |
{% if opt.values contains var.option1 %} | |
{{var.option1}} | |
{% elsif opt.values contains var.option2 %} | |
{{var.option2}} | |
{% elsif opt.values contains var.option3 %} | |
{{var.option3}} | |
{% endif %} | |
{% endfor %} | |
{% break %} | |
{% endif %} | |
{% endfor %} | |
<style> | |
.size-label { | |
padding: 3px; | |
margin: 2px; | |
border-radius: 3px; | |
white-space: nowrap; | |
} | |
.size-sold { | |
color:gray; | |
text-decoration:line-through; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment