Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.81 KB | None | 0 0
  1. {% comment %}
  2.  
  3. This is your /cart template.
  4.  
  5. {% endcomment %}
  6. <div id="CartSection" data-section-id="{{ section.id }}" data-section-type="cart-template" data-notes-enable="{{ section.settings.cart_notes_enable }}">
  7. {% if cart.item_count > 0 %}
  8.  
  9. <form action="/cart" method="post" novalidate class="cart">
  10.  
  11. <div class="section-header">
  12. <h1 class="section-header__title">{{ 'cart.general.title' | t }}</h1>
  13. </div>
  14.  
  15. <div class="cart__row medium-down--hide cart__header-labels">
  16. <div class="grid--full">
  17. <div class="grid__item post-large--one-half push--post-large--one-half">
  18. <div class="grid--full">
  19. <div class="grid__item one-third medium-down--one-third">
  20. <span class="h4">{{ 'cart.label.price' | t }}</span>
  21. </div>
  22. <div class="grid__item one-third medium-down--one-third text-center">
  23. <span class="h4">{{ 'cart.label.quantity' | t }}</span>
  24. </div>
  25. <div class="grid__item one-third medium-down--one-third text-right">
  26. <span class="h4">{{ 'cart.label.total' | t }}</span>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32.  
  33. {% comment %}
  34. Loop through products in the cart
  35. {% endcomment %}
  36. {% for item in cart.items %}
  37. <div class="cart__row">
  38. <div class="grid--full cart__row--table-large">
  39.  
  40. <div class="grid__item post-large--one-half">
  41. <div class="grid">
  42.  
  43. <div class="grid__item one-third">
  44. <a href="{{ item.url | within: collections.all }}">
  45. {% unless item.image == blank %}
  46. {% capture img_id %}ProductImage-{{ item.id }}{% endcapture %}
  47. {% capture wrapper_id %}ProductImageWrapper-{{ item.id }}{% endcapture %}
  48. {%- assign img_url = item.image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
  49. {% include 'image-style' with image: item.image, width: 210, height: 245, wrapper_id: wrapper_id, img_id: img_id %}
  50. <div id="{{ wrapper_id }}" class="cart__image-wrapper supports-js">
  51. <div style="padding-top:{{ 1 | divided_by: item.image.aspect_ratio | times: 100}}%;">
  52. <img id="{{ img_id }}"
  53. class="cart__image lazyload"
  54. data-src="{{ img_url }}"
  55. data-widths="[40, 65, 90, 120, 150, 180, 360, 480, 600]"
  56. data-aspectratio="{{ item.image.aspect_ratio }}"
  57. data-sizes="auto"
  58. alt="{{ item.title | escape }}">
  59. </div>
  60. </div>
  61. {% else %}
  62. <p><img src="{{ item | img_url: 'medium' }}" alt="{{ item.title | escape }}"></p>
  63. {% endunless %}
  64.  
  65. <noscript>
  66. <p><img src="{{ item | img_url: 'medium' }}" alt="{{ item.title | escape }}"></p>
  67. </noscript>
  68. </a>
  69. </div>
  70.  
  71. <div class="grid__item two-thirds">
  72. <a href="{{ item.url }}" class="h5">
  73. {{ item.product.title }}
  74. </a>
  75. {% unless item.variant.title contains 'Default' %}
  76. <br>
  77. <small>{{ item.variant.title }}</small>
  78. {% endunless %}
  79.  
  80. {% comment %}
  81. Optional, loop through custom product line items if available
  82.  
  83. For more info on line item properties, visit:
  84. - http://docs.shopify.com/support/your-store/products/how-do-I-collect-additional-information-on-the-product-page-Like-for-a-monogram-engraving-or-customization
  85. {% endcomment %}
  86. {% assign propertySize = item.properties | size %}
  87. {% if propertySize > 0 %}
  88. {% for p in item.properties %}
  89. {% assign first_character_in_key = p.first | truncate: 1, '' %}
  90. {% unless p.last == blank or first_character_in_key == '_' %}
  91. <br>
  92. {{ p.first }}:
  93.  
  94. {% comment %}
  95. Check if there was an uploaded file associated
  96. {% endcomment %}
  97. {% if p.last contains '/uploads/' %}
  98. <a href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
  99. {% else %}
  100. {{ p.last }}
  101. {% endif %}
  102.  
  103. {% endunless %}
  104. {% endfor %}
  105. {% endif %}
  106.  
  107. <a href="/cart/change?line={{ forloop.index }}&amp;quantity=0" class="cart__remove">
  108. <small>{{ 'cart.general.remove' | t }}</small>
  109. </a>
  110. </div>
  111.  
  112. </div>
  113. </div>
  114.  
  115. <div class="grid__item post-large--one-half">
  116. <div class="grid--full cart__row--table-large">
  117.  
  118. <div class="grid__item one-third">
  119. <span class="cart__mini-labels">{{ 'cart.label.price' | t }}</span>
  120. <span class="h5">{{ item.price | money }}</span>
  121. </div>
  122.  
  123. <div class="grid__item one-third text-center">
  124. <label for="updates_{{ item.key }}" class="cart__mini-labels">{{ 'cart.label.quantity' | t }}</label>
  125. <input type="number" class="cart__quantity-selector" name="updates[]" id="updates_{{ item.key }}" value="{{ item.quantity }}" min="0" aria-label="{{ 'cart.label.quantity' | t }}">
  126. </div>
  127.  
  128. <div class="grid__item one-third text-right">
  129. <span class="cart__mini-labels">{{ 'cart.label.total' | t }}</span>
  130. <span class="h5">
  131. {% if item.original_line_price != item.line_price %}
  132. <small class="cart-item__original-price"><s>{{ item.original_line_price | money }}</s></small>
  133. {% endif %}
  134. {{ item.line_price | money }}
  135. </span>
  136. {% if item.original_line_price != item.line_price %}
  137. {% for discount in item.discounts %}
  138. <small class="cart-item__discount">
  139. {{ discount.title }}
  140. </small>
  141. {% endfor %}
  142. {% endif %}
  143. </div>
  144.  
  145. </div>
  146. </div>
  147.  
  148. </div>
  149. </div>
  150. {% endfor %}
  151.  
  152. <div class="cart__row">
  153. <div class="grid">
  154. {% comment %}
  155. Optional, add a textarea for special notes
  156. - Your theme settings can turn this on or off. Default is on.
  157. - Make sure you have name="note" for the message to be submitted properly
  158. {% endcomment %}
  159. {% if section.settings.cart_notes_enable %}
  160. {% assign noteSize = cart.note | size %}
  161. <div class="grid__item post-large--five-twelfths">
  162. <button type="button" class="text-link cart__note-add{% if noteSize > 0 %} is-hidden{% endif %}">
  163. {{ 'cart.label.add_note' | t }}
  164. </button>
  165. <div class="cart__note{% if noteSize > 0 %} is-active{% endif %}">
  166. <label for="CartSpecialInstructions">{{ 'cart.general.note' | t }}</label>
  167. <textarea name="note" class="input-full" id="CartSpecialInstructions">{{ cart.note }}</textarea>
  168. </div>
  169. </div>
  170. {% endif %}
  171. <div class="grid__item text-right{% if section.settings.cart_notes_enable %} post-large--seven-twelfths{% endif %}">
  172. <p>
  173. <span class="cart__subtotal-title">{{ 'cart.general.subtotal' | t }}</span>
  174. <span class="h5 cart__subtotal">{{ cart.total_price | money }}</span>
  175. {% if cart.total_discounts > 0 %}
  176. {% assign savings = cart.total_discounts | money %}
  177. <small class="cart-subtotal__savings">{{ 'cart.general.savings_html' | t: price: savings }}</small>
  178. {% endif %}
  179. </p>
  180. <p><em>{{ 'cart.general.shipping_at_checkout' | t }}</em></p>
  181.  
  182. {% comment %}
  183. Continue shopping button
  184. {% endcomment %}
  185. <a class="btn--secondary" href="/collections/all">{{ 'cart.general.continue_shopping' | t }}</a>
  186.  
  187. <button type="submit" name="update" class="btn--secondary update-cart">{{ 'cart.general.update' | t }}</button>
  188. <button type="submit" name="checkout" class="btn">{{ 'cart.general.checkout' | t }}</button>
  189.  
  190. {% if additional_checkout_buttons %}
  191. <div class="cart__additional_checkout">{{ content_for_additional_checkout_buttons }}</div>
  192. {% endif %}
  193. </div>
  194. </div>
  195.  
  196. </div>
  197.  
  198. </form>
  199.  
  200. {% else %}
  201. {% comment %}
  202. The cart is empty
  203. {% endcomment %}
  204. <h2>{{ 'cart.general.title' | t }}</h2>
  205. <p class="cart--empty-message">{{ 'cart.general.empty' | t }}</p>
  206. <div class="cart--cookie-message">
  207. <p>{{ 'cart.general.cookies_required' | t }}</p>
  208. </div>
  209. <p class="cart__continue-btn">{{ 'cart.general.continue_browsing_html' | t }}</p>
  210. {% endif %}
  211. </div>
  212.  
  213. {% schema %}
  214. {
  215. "name": "Cart page",
  216. "settings": [
  217. {
  218. "type": "checkbox",
  219. "id": "cart_notes_enable",
  220. "label": "Enable order notes"
  221. }
  222. ]
  223. }
  224. {% endschema %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement