-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart.liquid
131 lines (117 loc) · 5.49 KB
/
cart.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!-- /templates/cart.liquid -->
{% comment %}
For info on test orders:
- General http://docs.shopify.com/manual/your-store/orders/test-orders
- Shopify Payments - http://docs.shopify.com/manual/more/shopify-payments/testing-shopify-payments
{% endcomment %}
{% assign processCheckout = true %}
{% if cart.item_count > 0 %}
<h1>{{ 'cart.general.title' | t }}</h1>
<form action="/cart" method="post" novalidate class="cart table-wrap">
<table class="cart-table full table--responsive">
<thead class="cart__row cart__header-labels">
<th colspan="2" class="text-center">{{ 'cart.label.product' | t }}</th>
<th class="text-center">{{ 'cart.label.price' | t }}</th>
<th class="text-center">{{ 'cart.label.quantity' | t }}</th>
<th class="text-right">{{ 'cart.label.total' | t }}</th>
</thead>
<tbody>
{% for item in cart.items %}
<tr class="cart__row table__section">
<td data-label="{{ 'customer.order.product' | t }}">
<a href="{{ item.url | within: collections.all }}" class="cart__image">
{% comment %}
More image size options at:
- http://docs.shopify.com/themes/filters/product-img-url
{% endcomment %}
<img src="{{ item | img_url: 'medium' }}" alt="{{ item.title | escape }}">
</a>
</td>
<td>
<a href="{{ item.url }}" class="h4">
{{ item.product.title }}
</a>
{% unless item.variant.title contains 'Default' %}
<br>
<small>{{ item.variant.title }}</small>
{% endunless %}
{% if settings.cart_vendor_enable %}
<p>{{ item.vendor }}</p>
{% endif %}
{% comment %}
Optional, loop through custom product line items if available
For more info on line item properties, visit:
- 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
{% endcomment %}
{% assign property_size = item.properties | size %}
{% if property_size > 0 %}
{% for p in item.properties %}
{% unless p.last == blank %}
{{ p.first }}:
{% comment %}
Check if there was an uploaded file associated
{% endcomment %}
{% if p.last contains '/uploads/' %}
<a href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
{% else %}
{{ p.last }}
{% endif %}
<br>
{% endunless %}
{% endfor %}
{% endif %}
<a href="/cart/change?line={{ forloop.index }}&quantity=0" class="cart__remove">
<small>{{ 'cart.general.remove' | t }}</small>
</a>
</td>
<td data-label="{{ 'cart.label.price' | t }}">
<span class="h3">
{{ item.price | money }}
</span>
</td>
<td data-label="{{ 'cart.label.quantity' | t }}">
<input type="number" name="updates[]" id="updates_{{ item.id }}" value="{{ item.quantity }}" min="0" {% if item.variant.metafields.limit.max %} max="{{item.variant.metafields.limit.max}}"{% endif %}>
{% if item.quantity > item.variant.metafields.limit.max %}
<p class="cart_max-qty"><strong>Max Qty : {{item.variant.metafields.limit.max}}</strong></p>
{% assign processCheckout = false %}
{% endif %}
</td>
<td data-label="{{ 'cart.label.total' | t }}" class="text-right">
<span class="h3">
{{ item.line_price | money }}
</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="grid cart__row">
{% if settings.cart_notes_enable %}
<div class="grid__item two-thirds small--one-whole">
<label for="CartSpecialInstructions">{{ 'cart.general.note' | t }}</label>
<textarea name="note" class="input-full" id="CartSpecialInstructions">{{ cart.note }}</textarea>
</div>
{% endif %}
<div class="grid__item text-right{% if settings.cart_notes_enable %} one-third small--one-whole{% endif %}">
<p>
<span class="cart__subtotal-title">{{ 'cart.general.subtotal' | t }}</span>
<span class="h3 cart__subtotal">{{ cart.total_price | money }}</span>
</p>
<p><em>{{ 'cart.general.shipping_at_checkout' | t }}</em></p>
<input type="submit" name="update" class="btn--secondary update-cart" value="{{ 'cart.general.update' | t }}">
{% if processCheckout %}
<input type="submit" name="checkout" class="btn" value="{{ 'cart.general.checkout' | t }}">
{% else %}
<p class="info-message">One or more items exceeds the maximum limit. Please reduce to the quantity to proceed to checkout. </p>
{% endif %}
</div>
</div>
</form>
{% else %}
{% comment %}
The cart is empty
{% endcomment %}
<h2>{{ 'cart.general.title' | t }}</h2>
<p>{{ 'cart.general.empty' | t }}</p>
<p>{{ 'cart.general.continue_browsing_html' | t }}</p>
{% endif %}