Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% assign collection = collections.all %}
- {% paginate collection.products by 100 %}
- <div class="tab-container">
- <ul class="tabs">
- {% for product in collection.products %}
- {% if product.available %}
- <li class="tab-link current" data-tab="tab-{% increment%}"><img src="{{ variant.image | default: product.featured_image | img_url: 'small' }}" alt="{{ variant.title | escape }}" /></li>
- {%endif%}
- {%endfor%}
- </ul>
- </div>
- <form class="product-form" action="/cart" method="post" enctype="multipart/form-data">
- {% if collection.products_count > 0 %}
- <body>
- <div>
- {% for product in collection.products %}
- {% if product.available %}
- <div id="tab-{% increment count%}" class="tab-content">
- {% for variant in product.variants %}
- {% if variant.available %}
- <tr class="{% cycle 'pure-table-odd', '' %}">
- <ul>
- <td>
- <a href="{{ variant.url | collection }}">
- {{ product.title }}{% unless variant.title contains 'Default' %} - {{ variant.title }}{% endunless %}{% unless variant.sku == blank %} - {{ variant.sku }}{% endunless %}
- </a>
- </td>
- <td>
- {{ variant.price | money }}
- </td>
- <td style="text-align:right;">
- <input name="updates[{{ variant.id }}]" onfocus="this.select()" class="quantity field" min="0" {% unless variant.inventory_management == blank or variant.inventory_policy == 'continue' %} max="{{ variant.inventory_quantity }}" {% endunless %} type="text" value="0" tabindex="1" />
- </td>
- </ul>
- {% endif %}
- {% endfor %}
- </div>
- {% endif %}
- </tr>
- {% endfor %}
- <div>
- <button class="btn btn--to-secondary btn--full product__add-to-cart-button" data-cart-submit type="submit" name="Add">
- <span class="primary-text" aria-hidden=false data-cart-primary-submit-text>
- Order
- </span>
- <span class="secondary-text" aria-hidden=true data-cart-secondary-submit-text>{{ 'products.product.view_cart' | t }}</span>
- </button>
- </div>
- </div>
- </div>
- </body>
- {% endif %}
- </form>
- {% endpaginate %}
- {% if collection.products_count > 0 %}
- <script>
- jQuery(function($) {
- $('table .quantity:first').focus();
- $('[max]').change(function() {
- var max = parseInt($(this).attr('max'), 10);
- var value = parseInt($(this).val(), 10) || 0;
- if (value > max) {
- alert('We only have ' + max + ' of this item in stock');
- $(this).val(max);
- }
- });
- });
- </script>
- {% endif %}
Add Comment
Please, Sign In to add comment