Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. <link itemprop="availability" href="http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}">
  2.  
  3. {% capture "form_class" -%}
  4. addToCartForm{% if section.settings.enable_payment_button %} addToCartForm--payment-button{% endif %}
  5. {%- endcapture %}
  6.  
  7. {%- capture "form_id" -%}addToCartForm-{{ section.id }}{%- endcapture -%}
  8.  
  9. {% form 'product', product, class:form_class, id:form_id %}
  10. <select name="id" id="productSelect-{{ section.id }}" class="product-variants product-variants-{{ section.id }}">
  11. {% for variant in product.variants %}
  12. {% if variant.available %}
  13.  
  14. <option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} data-sku="{{ variant.sku }}" value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option>
  15.  
  16. {% else %}
  17. <option disabled="disabled">
  18. {{ variant.title }} - {{ 'products.product.sold_out' | t }}
  19. </option>
  20. {% endif %}
  21. {% endfor %}
  22. </select>
  23.  
  24. {% if section.settings.product_quantity_enable %}
  25. <label for="quantity" class="quantity-selector quantity-selector-{{ section.id }}">{{ 'products.product.quantity' | t }}</label>
  26. <input type="number" id="quantity" name="quantity" value="1" min="1" class="quantity-selector">
  27. {% endif %}
  28.  
  29. {% comment %} Adjusted by Salvatore D @ Shopify on August 31, 2018 - APPLIED FIX {% endcomment %}
  30. {% if section.settings.product_quantity_message %}
  31. <div id="variantQuantity-{{ section.id }}" class="variant-quantity {% if variant.inventory_management and variant.inventory_quantity > 0 %} is-visible{% endif %}">
  32.  
  33. {% assign qty = variant.inventory_quantity %}
  34. <span id="variantQuantity-{{ section.id }}__message">{{ 'products.product.only_left' | t: count: qty }}</span>
  35. </div>
  36. {% endif %}
  37.  
  38. {% if section.settings.product_incoming_message %}
  39. <div id="variantIncoming-{{ section.id }}" class="variant-sold-out variant-quantity {% if variant.inventory_management and variant.inventory_quantity <= 0 %} is-visible{% endif %}">
  40. {% if variant.inventory_management and variant.inventory_quantity <= 0 and current_variant.incoming %}
  41. {% include 'svg-definitions' with 'stock-icon' %}
  42. {% if variant.available %}
  43. {% assign date = variant.next_incoming_date | date: "day_month_year" %}
  44. <span id="variantIncoming-{{ section.id }}__message">{{ 'products.product.will_not_ship_until' | t: date: date }}</span>
  45. {% else %}
  46. {% assign date = variant.next_incoming_date | date: "month_day_year" %}
  47. <span id="variantIncoming-{{ section.id }}__message">{{ 'products.product.will_be_in_stock_after' | t: date: date }}</span>
  48. {% endif %}
  49. {% elsif variant.inventory_management and variant.inventory_quantity <= 0 and current_variant.incoming == false %}
  50. <span id="variantIncoming-{{ section.id }}__message">Lagerstatus: ikke pƄ lager</span>
  51. {% else %}
  52. <span id="variantIncoming-{{ section.id }}__message"></span>
  53. {% endif %}
  54. </div>
  55. {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement