-
Notifications
You must be signed in to change notification settings - Fork 0
/
order-confirmation.liquid
258 lines (226 loc) · 8.7 KB
/
order-confirmation.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
{% capture email_title %}Thank you for your purchase! {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
{% case delivery_method %}
{% when 'pick-up' %}
You’ll receive an email when your order is ready for pickup.
{% else %}
Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent.
{% endcase %}
{% endif %}
{% endcapture %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ email_title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<style>
.button { background: {{ shop.email_accent_color }}; }
a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
</style>
</head>
<body>
{%- if shop.email_logo_url %}
<img src="{{ shop.email_logo_url }}" alt="{{ shop.name }}" width="{{ shop.email_logo_width }}">
{%- else %}
<h1>
<a href="{{ shop.url }}">{{ shop.name }}</a>
</h1>
{%- endif %}
<h2>Order {{ order_name }}</h2>
<h2>{{ email_title }}</h2>
<p>{{ email_body }}</p>
{% if order_status_url %}
<a href="{{ order_status_url }}">View your order</a>
{% if shop.url %}
or <a href="{{ shop.url }}">Visit our store</a>
{% endif %}
{% else %}
{% if shop.url %}
<a href="{{ shop.url }}">Visit our store</a>
{% endif %}
{% endif %}
{% assign gift_card_line_item = line_items | where: "gift_card" %}
{% if gift_card_line_item.first %}
<h3>Gift card</h3>
<p> You’ll receive separate emails for any gift cards.</p>
{% endif %}
<h3>Order summary</h3>
{% for line in subtotal_line_items %}
{% if line.image %}
<img src="{{ line | img_url: 'compact_cropped' }}" align="left" width="60" height="60" />
{% endif %}
{% if line.product.title %}
{% assign line_title = line.product.title %}
{% else %}
{% assign line_title = line.title %}
{% endif %}
{% if line.quantity < line.quantity %}
{% capture line_display %} {{ line.quantity }} of {{ line.quantity }} {% endcapture %}
{% else %}
{% assign line_display = line.quantity %}
{% endif %}
{{ line_title }} × {{ line_display }}
{% if line.variant.title != 'Default Title' %}
{{ line.variant.title }}
{% endif %}
{% if line.selling_plan_allocation %}
{{ line.selling_plan_allocation.selling_plan.name }}
{% endif %}
{% if line.refunded_quantity > 0 %}
Refunded
{% endif %}
{% if line.discount_allocations %}
{% for discount_allocation in line.discount_allocations %}
{% if discount_allocation.discount_application.target_selection != 'all' %}
<img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" />
{{ discount_allocation.discount_application.title | upcase }}
(-{{ discount_allocation.amount | money }})
{% endif %}
{% endfor %}
{% endif %}
{% if line.original_line_price != line.final_line_price %}
<del>{{ line.original_line_price | money }}</del>
{% endif %}
<p>
{% if line.final_line_price > 0 %}
{{ line.final_line_price | money }}
{% else %}
Free
{% endif %}
</p>
{% endfor %}
{% for discount_application in discount_applications %}
{% if discount_application.target_selection == 'all' %}
{% capture discount_title %}
{% if discount_application.title %}
{{ discount_application.title | upcase }}
{% else %}
Discount
{% endif %}
{% endcapture %}
<p>
Discount
<img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" />
{{ discount_title }}
</p>
<strong>-{{ discount_application.total_allocated_amount | money }}</strong>
{% endif %}
{% endfor %}
<p>
Subtotal
</p>
<strong>{{ subtotal_price | money }}</strong>
{% if delivery_method == 'pick-up' %}
<p>
Pickup
</p>
<strong>{{ shipping_price | money }}</strong>
{% else %}
<p>
Shipping
</p>
<strong>{{ shipping_price | money }}</strong>
{% endif %}
{% if current_total_duties %}
<p>
Duties
</p>
<strong>{{ current_total_duties | money }}</strong>
{% endif %}
<p>
Taxes
</p>
<strong>{{ tax_price | money }}</strong>
{% if total_tip and total_tip > 0 %}
<p>
Tip
</p>
<strong>{{ total_tip | money }}</strong>
{% endif %}
<p>
Total
</p>
<strong>{{ total_price | money_with_currency }}</strong>
{% if total_discounts > 0 %}
<p>
You saved {{ total_discounts | money }}
</p>
{% endif %}
{% assign transaction_size = 0 %}
{% assign transaction_amount = 0 %}
{% for transaction in transactions %}
{% unless transaction.kind == "capture" or transaction.kind == "void" %}
{% assign transaction_size = transaction_size | plus: 1 %}
{% assign transaction_amount = transaction_amount | plus: transaction.amount %}
{% endunless %}
{% endfor %}
{% if transaction_size > 1 or transaction_amount < total_price %}
{% for transaction in transactions %}
{% if transaction.status == "success" and transaction.kind == "authorization" or transaction.kind == "sale" %}
{% if transaction.payment_details.credit_card_company %}
{% capture transaction_name %}{{ transaction.payment_details.credit_card_company }} (ending in {{ transaction.payment_details.credit_card_last_four_digits }}){% endcapture %}
{% else %}
{% capture transaction_name %}{{ transaction.gateway_display_name }}{% endcapture %}
{% endif %}
<p>
{{ transaction_name }}
</p>
<strong>{{ transaction.amount | money }}</strong>
{% endif %}
{% if transaction.kind == 'refund' %}
{% if transaction.payment_details.credit_card_company %}
{% assign refund_method_title = transaction.payment_details.credit_card_company %}
{% else %}
{% assign refund_method_title = transaction.gateway %}
{% endif %}
<p>
Refund {{ refund_method_title | capitalize }}
</p>
<strong>- {{ transaction.amount | money }}</strong>
{% endif %}
{% endfor %}
{% endif %}
<h3>Customer information</h3>
{% if requires_shipping and shipping_address %}
<h4>Shipping address</h4>
{{ shipping_address | format_address }}
{% endif %}
{% if billing_address %}
<h4>Billing address</h4>
{{ billing_address | format_address }}
{% endif %}
{% if requires_shipping and shipping_address %}
<h4>Shipping method</h4>
<p>{{ shipping_method.title }}</p>
{% endif %}
{% assign transaction_count = transactions | size %}
{% if transaction_count > 0 %}
<h4>Payment method</h4>
{% for transaction in transactions %}
{% if transaction.status == "success" or transaction.status == "pending" %}
{% if transaction.kind == "authorization" or transaction.kind == "sale" %}
{% if transaction.payment_details.credit_card_company %}
<p>
<img src="{{ transaction.payment_details.credit_card_company | payment_icon_png_url }}" height="24" alt="{{ transaction.payment_details.credit_card_company }}">
ending with {{ transaction.payment_details.credit_card_last_four_digits }} — <strong>{{ transaction.amount | money }}</strong>
</p>
{% elsif transaction.gateway_display_name == "Gift card" %}
<p>
<img src="{{ transaction.gateway_display_name | downcase | replace: ' ', '-' | payment_type_img_url }}" height="24">
ending with {{ transaction.payment_details.gift_card.last_four_characters | upcase }} — <strong>{{ transaction.amount | money }}</strong> <br />
    Gift card balance: {{ transaction.payment_details.gift_card.balance | money }}
</p>
{% else %}
<p>
{{ transaction.gateway_display_name }} — <strong>{{ transaction.amount | money }}</strong>
</p>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
<p>If you have any questions, reply to this email or contact us at <a href="mailto:{{ shop.email }}">{{ shop.email }}</a></p>
</body>
</html>