-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart.inc.twig
356 lines (338 loc) · 17.1 KB
/
cart.inc.twig
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
{# BEGIN CART TWIG TEMPLATE #}
{% block cart %}
{% block cart_begin %}
{% if not for_email %}
<!-- begin cart output -->
<div id="fc_cart_container"><div id="fc_cart_container_inner">
{% endif %}
{% if with_controls %}
<noscript>
<div id="fc_error_noscript" class="fc_error">
<h3>{{ lang.cart_warning|raw }}:</h3>
<p>{{ lang.cart_no_javascript_message|raw }}</p>
</div><!-- #fc_errorNoScript -->
</noscript>
<form id="fc_cart_form" action="https://{{ store_domain }}{{ post_url }}" method="post">
<div id="fc_cart_controls_top" class="fc_cart_controls">
{% block cart_controls %}
<input type="hidden" name="cart" value="update" />
<input type="hidden" name="item_count" value="{{ items|length }}" />
<input type="hidden" name="{{ session_name }}" value="{{ session_id }}" />
{% if supports_paypal_express or show_amazon_fps_button %}
<a class="fc_link_nav fc_cart_update fc_cart_update_paypal" href="#" onclick="fc_UpdateCart();return false;">{{ lang.cart_update_cart|raw }}</a>
{% else %}
<a class="fc_link_nav fc_cart_update" href="#" onclick="fc_UpdateCart();return false;">{{ lang.cart_update_cart|raw }}</a>
{% endif %}
{% if items|length > 0 %}
{% if supports_paypal_express and show_amazon_fps_button %}
<div class="fc_cart_alternate_payments">
{% endif %}
{% if supports_paypal_express %}
<a class="fc_link_nav fc_link_forward fc_cart_checkout_paypal" href="https://{{ store_domain }}/checkout.php?ThisAction=paypal_express&{{ session_name }}={{ session_id }}" target="_top">
<img src="{{ paypal_checkout_button_url }}" />
</a>
{% endif %}
{% if show_amazon_fps_button %}
<a class="fc_link_nav fc_link_forward fc_cart_checkout_paypal fc_cart_checkout_amazon" href="https://{{ store_domain }}/checkout.php?ThisAction=checkout&fc_payment_method=amazon_fps" target="_top">
<img src="https://cdn.foxycart.com/static/images/payment_logos/amazon.png" />
</a>
{% endif %}
{% if supports_paypal_express and show_amazon_fps_button %}
</div>
{% endif %}
{% if supports_paypal_express or show_amazon_fps_button %}
<span class="fc_cart_checkout_or">-OR-</span>
{% endif %}
<a class="fc_link_nav fc_link_forward fc_cart_checkout" href="https://{{ store_domain }}/checkout.php?{{ session_name }}={{ session_id }}" target="_top">{{ lang.cart_checkout|raw }}</a>
{% endif %}
{% endblock cart_controls %}
</div><!-- #fc_cart_controls_top -->
{% endif %}
{% if with_controls %}
{{ html_messages|raw }}
{% endif %}
{% if for_email %}
<table id="fc_cart_table" width="100%" style="font-size:12px; text-align:left;" cellspacing="0" cellpadding="5">
{% else %}
<table id="fc_cart_table" cellspacing="0" cellpadding="0">
{% endif %}
<caption>{{ lang.cart_caption|raw }}</caption>
{% endblock cart_begin %}
{% block header %}
{% if not for_email %}
<thead>
{% endif %}
<tr id="fc_cart_head">
{% if has_product_images %}
<th{{ css_styles.background }} id="fc_cart_head_image"><span>{{ lang.cart_image|raw }}</span></th>
{% endif %}
<th{{ css_styles.background }} id="fc_cart_head_item"><span>{{ lang.cart_item|raw }}</span></th>
<th{{ css_styles.background }} id="fc_cart_head_quantity"><span>{{ lang.cart_quantity|raw }}</span></th>
<th{{ css_styles.background }} id="fc_cart_head_price"><span>{{ lang.cart_price|raw }}</span></th>
</tr>
{% if not for_email %}
</thead>
{% endif %}
{% endblock header %}
{% block footer %}
{% if not for_email %}
<tfoot>
{% endif %}
<tr id="fc_cart_foot_subtotal">
<td{{ css_styles.border2_right }} class="fc_col1" colspan="{{ colspan-1 }}" >{{ lang.cart_subtotal|raw }}:</td>
<td{{ css_styles.border2 }} class="fc_col2">{{ cart_sub_total }}</td>
</tr>
{% if has_future_products %}
<tr id="fc_cart_foot_subscriptions">
<td class="fc_col1" colspan="{{ colspan-1 }}">{{ lang.cart_future_subscriptions|raw }}:</td>
<td{{ css_styles.right }} class="fc_col2">{{ future_total_price }}</td>
</tr>
{% endif %}
{% for coupon in coupons %}
{% if not coupon.is_applied %}
<tr class="fc_cart_foot_discount fc_coupon_unapplied">
{% else %}
<tr class="fc_cart_foot_discount">
{% endif %}
<td{{ css_styles.right }} class="fc_col1" colspan="{{ colspan-1 }}">
{{ coupon.name }}: {{ coupon.code }}
</td>
<td class="fc_col2">
<span class="fc_discount">{{ coupon.amount }}</span>
{% if with_controls %}
<span class="fc_cart_coupon_remove">
<a href="https://{{ store_domain }}{{ post_url }}?cart=remove_coupon&coupon_code_id={{ coupon.id }}&{{ session_name }}={{ session_id }}" class="fc_cart_remove_link" title="{{ lang.cart_remove_coupon|raw }}">[x]</a>
</span>
{% endif %}
</td>
</tr>
{% endfor %}
{% for coupon in future_coupons %}
<tr class="fc_cart_foot_discount fc_future">
<td{{ css_styles.right }} class="fc_col1" colspan="{{ colspan-1 }}">
{{ lang.cart_future_subscriptions|raw }} {{ coupon.name }}: {{ coupon.code }}
</td>
<td class="fc_col2">
<span class="fc_discount">{{ coupon.amount }}</span>
</td>
</tr>
{% endfor %}
{% if with_controls and has_eligible_coupons %}
<tr id="fc_cart_foot_discount_new">
<td{{ css_styles.right }} class="fc_col1" colspan="{{ colspan-1 }}">
<a href="#" onclick="fc_AddCoupon(); this.blur(); return false;">{{ lang.cart_add_coupon|raw }}</a>
</td>
<td class="fc_col2">
<input type="text" name="coupon" id="fc_coupon" class="fc_text fc_text_short" value="" style="display:none;" />
</td>
</tr>
{% endif %}
{% if not with_controls %}
{% if show_shipping_tbd %}
<tr id="fc_cart_foot_shipping_tbd">
<td{{ css_styles.right }} class="fc_col1" colspan="{{ colspan-1 }}">{{ shipping_and_handling_label|raw }}:</td>
<td class="fc_col2">{{ lang.checkout_tbd|raw }}</td>
</tr>
{% endif %}
{% if show_shipping_tbd and hide_shipping_row %}
<tr id="fc_cart_foot_shipping" style="display: none;">
{% else %}
<tr id="fc_cart_foot_shipping">
{% endif %}
<td{{ css_styles.right }} class="fc_col1" colspan="{{ colspan-1 }}">{{ shipping_and_handling_label|raw }}:</td>
{% if show_shipping_tbd %}
<td class="fc_col2">{{ lang.checkout_tbd|raw }}</td>
{% else %}
<td class="fc_col2">{{ cart_total_shipping }}</td>
{% endif %}
</tr>
{% if has_future_products %}
{% if show_future_shipping_and_handling %}
<tr id="fc_cart_foot_future_shipping">
{% else %}
<tr id="fc_cart_foot_future_shipping" style="display: none;">
{% endif %}
<td{{ css_styles.right }} class="fc_col1" colspan="{{ colspan-1 }}">{{ lang.cart_future_subscriptions|raw }} {{ shipping_and_handling_label|raw }}:</td>
<td class="fc_col2">{{ future_shipping_and_handling }}</td>
</tr>
{% endif %}
{% if has_taxes %}
{% for tax in taxes %}
{% if tax.show_tax %}
<tr id="fc_cart_foot_tax_{{ tax.id }}" class="fc_cart_foot_tax">
<td{{ css_styles.right }} class="fc_col1" colspan="{{ colspan-1 }}">{{ tax.description|raw }}:</td>
<td class="fc_col2">{{ tax.amount }}</td>
</tr>
{% else %}
{% if not for_email %}
<tr id="fc_cart_foot_tax_{{ tax.id }}" class="fc_cart_foot_tax" style="display: none;">
<td{{ css_styles.right }} class="fc_col1" colspan="{{ colspan-1 }}">{{ tax.description|raw }}:</td>
<td class="fc_col2">{{ tax.amount }}</td>
</tr>
{% endif %}
{% endif %}
{% endfor %}
{% if show_tax_tbd %}
{% if tax_total <= 0 %}
<tr id="fc_cart_foot_tax_tbd">
{% else %}
<tr id="fc_cart_foot_tax_tbd" style="display: none;">
{% endif %}
<td class="fc_col1" colspan="{{ colspan-1 }}">{{ lang.checkout_tax|raw }}:</td>
<td class="fc_col2">{{ lang.checkout_tbd|raw }}</td>
</tr>
{% endif %}
{% endif %}
{% endif %}
<tr id="fc_cart_foot_total">
<td class="fc_col1" colspan="{{ colspan-1 }}">{{ lang.cart_order_total|raw }}:</td>
<td class="fc_col2">{{ cart_order_total }}</td>
</tr>
{% if not for_email %}
</tfoot>
{% endif %}
{% endblock footer %}
{% block body %}
{% if not has_multiship and not for_email %}
<tbody>
{% endif %}
{% for item in items %}
{% if item.multiship >= 0 %}
{% if item.multiship > 0 and not for_email %}
</tbody>
{% endif %}
{% if not for_email %}
<tbody class="fc_ship_to">
{% endif %}
<tr>
<th id="fc_shipto_{{ item.multiship }}_cart_row" class="fc_shipto" colspan="{{ colspan }}">
{{ lang.cart_shipto|raw }}: {{ item.shipto }}
</th>
</tr>
{% endif %}
{% if item.item_number == items|length %}
<tr id="product_{{ item.id }}" class="fc_cart_item fc_cart_item_last">
{% else %}
<tr id="product_{{ item.id }}" class="fc_cart_item">
{% endif %}
{% if has_product_images %}
<td class="fc_cart_item_image"{{ css_styles.border }}>
{% if item.image != '' %}
{% if item.url != '' %}
<a href="{{ item.url }}" target="_top" alt="{{ item.alt_name }}">
{% endif %}
<img class="fc_cart_thumbnail" src="{{ item.image }}" />
{% if item.url != '' %}
</a>
{% endif %}
{% endif %}
</td>
{% endif %}
<td class="fc_cart_item_details"{{ css_styles.border }}>
<span class="fc_cart_item_name">{{ item.name }}</span>
{% if item.options|length > 0 or item.code != '' or item.category_code != 'DEFAULT' or item.weight != 0 or item.subscription_frequency != '' %}
<ul class="fc_cart_item_options">
{% for option in item.options %}
<li class="fc_cart_item_option fc_cart_item_{{ option.class }}">
<span class="fc_cart_item_option_name">{{ option.name }}</span><span class="fc_cart_item_option_separator">:</span>
<span class="fc_cart_item_option_value">{{ option.value }}</span>
</li>
{% endfor %}
{% if item.code != '' %}
<li class="fc_cart_item_option fc_cart_item_code">
{{ lang.cart_code|raw }}: {{ item.code }}
</li>
{% endif %}
{% if item.category_code != 'DEFAULT' %}
<li class="fc_cart_item_option fc_cart_category_code">
{{ lang.cart_category|raw }}: {{ item.category_code }}
</li>
{% endif %}
{% if item.weight != 0 %}
<li class="fc_cart_item_option fc_cart_item_weight">
{{ lang.cart_weight|raw }}: {{ item.weight }} <span class="fc_uom_weight">{{ weight_uom }}</span>
</li>
{% endif %}
{% if item.subscription_frequency != '' %}
<li class="fc_cart_item_option fc_cart_item_subscription_details">
{{ lang.cart_subscription_details|raw }}
<ul>
<li class="fc_cart_item_option fc_cart_item_sub_frequency">
<span class="fc_cart_item_option_name">{{ lang.cart_frequency|raw }}</span><span class="fc_cart_item_option_separator">:</span> <span class="fc_cart_item_option_value">{{ item.subscription_frequency }}</span>
</li>
<li class="fc_cart_item_option fc_cart_item_sub_startdate">
<span class="fc_cart_item_option_name">{{ lang.cart_start_date|raw }}</span><span class="fc_cart_item_option_separator">:</span> <span class="fc_cart_item_option_value">{{ item.subscription_start_date }}</span>
</li>
<li class="fc_cart_item_option fc_cart_item_sub_nextdate">
<span class="fc_cart_item_option_name">{{ lang.cart_next_date|raw }}</span><span class="fc_cart_item_option_separator">:</span> <span class="fc_cart_item_option_value">{{ item.subscription_next_transaction_date }}</span>
</li>
{% if item.subscription_end_date != "0000-00-00" %}
<li class="fc_cart_item_option fc_cart_item_sub_enddate">
<span class="fc_cart_item_option_name">{{ lang.cart_end_date|raw }}</span><span class="fc_cart_item_option_separator">:</span> <span class="fc_cart_item_option_value">{{ item.subscription_end_date }}</span>
</li>
{% endif %}
</ul>
</li>
{% endif %}
</ul>
{% endif %}
{% if with_controls %}
<span class="fc_cart_remove_left">
<a href="#" onclick="fc_RemoveItem({{ item.item_number }}); return false;" class="fc_cart_remove_link" title="{{ lang.cart_remove_item|raw }}">[x]</a>
</span>
<input type="hidden" id="id{{ item.item_number }}" name="id{{ item.item_number }}" value="{{ item.id }}" />
{% endif %}
</td>
<td class="fc_cart_item_quantity"{{ css_styles.border }}>
{% if with_controls %}
<input class="fc_cart_item_quantity fc_text fc_text_short" type="text" id="quantity{{ item.item_number }}" name="quantity{{ item.item_number }}" value="{{ item.quantity }}" />
<span class="fc_cart_remove_center">
<a href="#" onclick="fc_RemoveItem({{ item.item_number }}); return false;" class="fc_cart_remove_link" title="{{ lang.cart_remove_item|raw }}">[x]</a>
</span>
{% else %}
{{ item.quantity }}
{% endif %}
</td>
<td class="fc_cart_item_price"{{ css_styles.border }}>
<span class="fc_cart_item_price_total">{{ item.price_total }}</span>
{% if item.quantity > 1 %}
<span class="fc_cart_item_price_each"> ({{ item.price_each }} {{ lang.cart_each|raw }})</span>
{% endif %}
{% if with_controls %}
<span class="fc_cart_remove_right">
<a href="#" onclick="fc_RemoveItem({{ item.item_number }}); return false;" class="fc_cart_remove_link" title="{{ lang.cart_remove_item|raw }}">[x]</a>
</span>
{% endif %}
</td>
</tr>
{% endfor %}
{% if not for_email %}
</tbody>
{% endif %}
{% endblock body %}
{% block cart_end %}
{% if items|length == 0 %}
{% if not for_email %}
<tbody>
{% endif %}
<tr class="fc_cart_item">
<td colspan="{{ colspan }}" id="fc_empty_cart">{{ lang.cart_empty|raw }}</td>
</tr>
{% if not for_email %}
</tbody>
{% endif %}
{% endif %}
</table>
{% if with_controls %}
<div id="fc_cart_controls_bottom" class="fc_cart_controls">
{{ block('cart_controls') }}
</div><!-- #fc_cart_controls_bottom -->
</form>
{% endif %}
{% if not for_email %}
</div></div><!-- #fc_cart_container_inner, #fc_cart_container -->
{% endif %}
<!-- end cart output -->
{% endblock cart_end %}
{% endblock cart %}
{# END CART TWIG TEMPLATE #}