Created
March 26, 2017 03:40
-
-
Save zakhardage/bdbec2689539b37790ce893257f4af12 to your computer and use it in GitHub Desktop.
product price table - hard coded value categories
This file contains hidden or 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 variant in product.variants %} | |
{% assign option = variant.option1 | downcase %} | |
{% assign p = variant.price | money %} | |
{% unless option contains '+' or option contains 'swatch' %} | |
{% if option contains '1-4' %} | |
{% assign one = p %} | |
{% else %} | |
{% unless option contains '-' %}{% assign one = p %}{% endunless %} | |
{% endif %} | |
{% endunless %} | |
{% if option contains '5+' or option contains '5-9' %}{% assign two = p %}{% endif %} | |
{% if option contains '10+' or option contains '10-19' %}{% assign three = p %}{% endif %} | |
{% if option contains '20+' or option contains '20-49' %}{% assign four = p %}{% endif %} | |
{% if option contains '50+' %}{% assign five = p %}{% endif %} | |
{% endfor %} | |
<table> | |
<colgroup> | |
<col span="1" class="col1"> | |
<col span="1" class="col2"> | |
</colgroup> | |
{% assign unit_term = product.variants[0].option1 | split:' ' %} | |
<tr><th>Qty</th><th>Price per {{ unit_term.last }}</th></tr> | |
<tr> | |
<td>1–4</td> | |
<td>{{ one }}</td> | |
</tr> | |
<tr> | |
<td>5–9</td> | |
<td>{{ two }}</td> | |
</tr> | |
<tr> | |
<td>10–19</td> | |
<td>{{ three }}</td> | |
</tr> | |
<tr> | |
<td>20–49</td> | |
<td>{{ four }}</td> | |
</tr> | |
<tr> | |
<td>50+</td> | |
<td>{{ five }}</td> | |
</tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment