File: _variants.liquid
{% if variants.size > 0 %} {% if variants.first.has_multiple_descriptors? %} <tr id="variants_{{ product.id }}" class="variantRow"> <td></td> <td colspan="{{ descriptor_count }}" class="variantInfo"> <select name="variant_select_{{ product.id }}" id="variant_select_{{ product.id }}" onchange="modifyDisplayedPrice(this, {{ product.id }}); return false;"> {% for variant in variants %} {% if variant.infinite_qty? %} <option value="{{ variant.id }}||{{ variant.price | money }}">{{ variant.info }}</option> {% else %} <option value="{{ variant.id }}|{{ variant.qty }}|{{ variant.price | money }}">{{ variant.info }}</option> {% endif %} {% endfor %} </select> </td> <td id="price_{{ product.id }}" align="center">{{ variants.first.price | money }}</td> <td id="qty_{{ product.id }}" align="center"> {% assign first_variant = variants.first %} {% unless first_variant.infinite_qty? %} {{ first_variant.qty }} {% endunless %} </td> <td><a href="#" onclick="addMultipleDescriptorVariantToCart({{ product.id }}); return false;">Add to Cart</a></td> </tr> {% else %} {% for variant in variants %} <tr id="variant_{{ variant.id }}" class="variantRow"> <td></td> <td colspan="{{ descriptor_count }}" class="variantInfo">{{ variant.info }}</td> <td align="center">{{ variant.price | money }}</td> <td align="center"> {% unless variant.infinite_qty? %} {{ variant.qty }} {% endunless %} </td> <td>{{ "img/buttons/add_cart.gif" | asset_url | image_tag | link_to_add_cart: product, variant }}</td> </tr> {% endfor %} {% endif %} {% else %} <tr> <td colspan="{{ descriptor_count }}"><em>No variants in stock.</em></td> </tr> {% endif %}
{% if variants.size > 0 %} {% if variants.first.has_multiple_descriptors? %} <tr id="variants_{{ product.id }}" class="variantRow"> <td></td> <td colspan="{{ descriptor_count }}" class="variantInfo"> <select name="variant_select_{{ product.id }}" id="variant_select_{{ product.id }}" onchange="modifyDisplayedPrice(this, {{ product.id }}); return false;"> {% for variant in variants %} {% if variant.infinite_qty? %} <option value="{{ variant.id }}||{{ variant.price | money }}">{{ variant.info }}</option> {% else %} <option value="{{ variant.id }}|{{ variant.qty }}|{{ variant.price | money }}">{{ variant.info }}</option> {% endif %} {% endfor %} </select> </td> <td id="price_{{ product.id }}" align="center">{{ variants.first.price | money }}</td> <td id="qty_{{ product.id }}" align="center"> {% assign first_variant = variants.first %} {% unless first_variant.infinite_qty? %} {{ first_variant.qty }} {% endunless %} </td> <td><a href="#" onclick="addMultipleDescriptorVariantToCart({{ product.id }}); return false;">Add to Cart</a></td> </tr> {% else %} {% for variant in variants %} <tr id="variant_{{ variant.id }}" class="variantRow"> <td></td> <td colspan="{{ descriptor_count }}" class="variantInfo">{{ variant.info }}</td> <td align="center">{{ variant.price | money }}</td> <td align="center"> {% unless variant.infinite_qty? %} {{ variant.qty }} {% endunless %} </td> <td>{{ "img/buttons/add_cart.gif" | asset_url | image_tag | link_to_add_cart: product, variant }}</td> </tr> {% endfor %} {% endif %} {% else %} <tr> <td colspan="{{ descriptor_count }}"><em>No variants in stock.</em></td> </tr> {% endif %}