-
Notifications
You must be signed in to change notification settings - Fork 27
/
order-carrier-advanced.tpl
398 lines (398 loc) · 20.9 KB
/
order-carrier-advanced.tpl
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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
{if !$opc}
{capture name=path}{l s='Shipping:'}{/capture}
{assign var='current_step' value='shipping'}
<div id="carrier_area">
<h2>{l s='Shipping:'}</h2>
{include file="$tpl_dir./order-steps.tpl"}
{include file="$tpl_dir./errors.tpl"}
<form id="form" action="{$link->getPageLink('order', true, NULL, "{if $multi_shipping}multi-shipping={$multi_shipping}{/if}")|escape:'html':'UTF-8'}" method="post" name="carrier_area">
{else}
<div id="carrier_area" class="opc-main-block">
<h2>{l s='Delivery methods'}</h2>
<div id="opc_delivery_methods" class="opc-main-block">
<div id="opc_delivery_methods-overlay" class="opc-overlay" style="display: none;"></div>
{/if}
<div class="order_carrier_content box">
{if isset($virtual_cart) && $virtual_cart}
<input id="input_virtual_carrier" class="hidden" type="hidden" name="id_carrier" value="0">
{else}
<div id="HOOK_BEFORECARRIER">
{if isset($carriers) && isset($HOOK_BEFORECARRIER)}
{$HOOK_BEFORECARRIER}
{/if}
</div>
{if isset($isVirtualCart) && $isVirtualCart}
<div class="alert alert-warning">{l s='No carrier is needed for this order.'}</div>
{else}
<div class="delivery_options_address">
{if isset($delivery_option_list)}
{foreach $delivery_option_list as $id_address => $option_list}
<p class="carrier_title">
{if isset($address_collection[$id_address])}
{l s='Choose a shipping option for this address:'} {$address_collection[$id_address]->alias}
{else}
{l s='Choose a shipping option'}
{/if}
</p>
<div class="delivery_options">
{foreach $option_list as $key => $option}
<div class="delivery_option">
<div>
<table class="resume table table-bordered{if !$option.unique_carrier} hide{/if}">
<tr>
<td class="delivery_option_radio">
<input id="delivery_option_{$id_address|intval}_{$option@index}" class="delivery_option_radio" type="radio" name="delivery_option[{$id_address|intval}]" data-key="{$key}" data-id_address="{$id_address|intval}" value="{$key}"{if isset($delivery_option[$id_address]) && $delivery_option[$id_address] == $key} checked="checked"{/if}>
</td>
<td class="delivery_option_logo">
{foreach $option.carrier_list as $carrier}
{if $carrier.logo}
<img class="order_carrier_logo" src="{$carrier.logo|escape:'htmlall':'UTF-8'}" alt="{$carrier.instance->name|escape:'htmlall':'UTF-8'}">
{elseif !$option.unique_carrier}
{$carrier.instance->name|escape:'htmlall':'UTF-8'}
{if !$carrier@last} - {/if}
{/if}
{/foreach}
</td>
<td>
{if $option.unique_carrier}
{foreach $option.carrier_list as $carrier}
<strong>{$carrier.instance->name|escape:'htmlall':'UTF-8'}</strong>
{/foreach}
{if isset($carrier.instance->delay[$cookie->id_lang])}
<br>{l s='Delivery time:'} {$carrier.instance->delay[$cookie->id_lang]|escape:'htmlall':'UTF-8'}
{/if}
{/if}
{if count($option_list) > 1}
<br>
{if $option.is_best_grade}
{if $option.is_best_price}
<span class="best_grade best_grade_price best_grade_speed">{l s='The best price and speed'}</span>
{else}
<span class="best_grade best_grade_speed">{l s='The fastest'}</span>
{/if}
{elseif $option.is_best_price}
<span class="best_grade best_grade_price">{l s='The best price'}</span>
{/if}
{/if}
</td>
<td class="delivery_option_price">
<div class="delivery_option_price">
{if $option.total_price_with_tax && !$option.is_free && (!isset($free_shipping) || (isset($free_shipping) && !$free_shipping))}
{if $use_taxes == 1}
{if $priceDisplay == 1}
{convertPrice price=$option.total_price_without_tax}{if $display_tax_label} {l s='(tax excl.)'}{/if}
{else}
{convertPrice price=$option.total_price_with_tax}{if $display_tax_label} {l s='(tax incl.)'}{/if}
{/if}
{else}
{convertPrice price=$option.total_price_without_tax}
{/if}
{else}
{l s='Free'}
{/if}
</div>
</td>
</tr>
</table>
{if !$option.unique_carrier}
<table class="delivery_option_carrier{if isset($delivery_option[$id_address]) && $delivery_option[$id_address] == $key} selected{/if} resume table table-bordered{if $option.unique_carrier} hide{/if}">
<tr>
{if !$option.unique_carrier}
<td rowspan="{$option.carrier_list|@count}" class="delivery_option_radio">
<input id="delivery_option_{$id_address|intval}_{$option@index}" class="delivery_option_radio" type="radio" name="delivery_option[{$id_address|intval}]" data-key="{$key}" data-id_address="{$id_address|intval}" value="{$key}"{if isset($delivery_option[$id_address]) && $delivery_option[$id_address] == $key} checked="checked"{/if}>
</td>
{/if}
{assign var="first" value=current($option.carrier_list)}
<td class="delivery_option_logo{if $first.product_list[0].carrier_list[0] eq 0} hide{/if}">
{if $first.logo}
<img class="order_carrier_logo" src="{$first.logo|escape:'htmlall':'UTF-8'}" alt="{$first.instance->name|escape:'htmlall':'UTF-8'}">
{elseif !$option.unique_carrier}
{$first.instance->name|escape:'htmlall':'UTF-8'}
{/if}
</td>
<td class="{if $first.product_list[0].carrier_list[0] eq 0} hide{/if}">
<input type="hidden" value="{$first.instance->id|intval}" name="id_carrier">
{if isset($first.instance->delay[$cookie->id_lang])}
<i class="icon icon-info-sign"></i>
{strip}
{$first.instance->delay[$cookie->id_lang]|escape:'htmlall':'UTF-8'}
{if count($first.product_list) <= 1}
({l s='For this product:'}
{else}
({l s='For these products:'}
{/if}
{/strip}
{foreach $first.product_list as $product}
{if $product@index == 4}
<abbr title="
{/if}
{strip}
{if $product@index >= 4}
{$product.name|escape:'htmlall':'UTF-8'}
{if isset($product.attributes) && $product.attributes}
{$product.attributes|escape:'htmlall':'UTF-8'}
{/if}
{if !$product@last}
,
{else}
">…</abbr>)
{/if}
{else}
{$product.name|escape:'htmlall':'UTF-8'}
{if isset($product.attributes) && $product.attributes}
{$product.attributes|escape:'htmlall':'UTF-8'}
{/if}
{if !$product@last}
,
{else}
)
{/if}
{/if}
{/strip}
{/foreach}
{/if}
</td>
<td rowspan="{$option.carrier_list|@count}" class="delivery_option_price">
<div class="delivery_option_price">
{if $option.total_price_with_tax && !$option.is_free && (!isset($free_shipping) || (isset($free_shipping) && !$free_shipping))}
{if $use_taxes == 1}
{if $priceDisplay == 1}
{convertPrice price=$option.total_price_without_tax}{if $display_tax_label} {l s='(tax excl.)'}{/if}
{else}
{convertPrice price=$option.total_price_with_tax}{if $display_tax_label} {l s='(tax incl.)'}{/if}
{/if}
{else}
{convertPrice price=$option.total_price_without_tax}
{/if}
{else}
{l s='Free'}
{/if}
</div>
</td>
</tr>
{foreach $option.carrier_list as $carrier}
{if $carrier@iteration != 1}
<tr>
<td class="delivery_option_logo{if $carrier.product_list[0].carrier_list[0] eq 0} hide{/if}">
{if $carrier.logo}
<img class="order_carrier_logo" src="{$carrier.logo|escape:'htmlall':'UTF-8'}" alt="{$carrier.instance->name|escape:'htmlall':'UTF-8'}">
{elseif !$option.unique_carrier}
{$carrier.instance->name|escape:'htmlall':'UTF-8'}
{/if}
</td>
<td class="{if $carrier.product_list[0].carrier_list[0] eq 0} hide{/if}">
<input type="hidden" value="{$first.instance->id|intval}" name="id_carrier">
{if isset($carrier.instance->delay[$cookie->id_lang])}
<i class="icon icon-info-sign"></i>
{strip}
{$carrier.instance->delay[$cookie->id_lang]|escape:'htmlall':'UTF-8'}
{if count($first.product_list) <= 1}
({l s='For this product:'}
{else}
({l s='For these products:'}
{/if}
{/strip}
{foreach $carrier.product_list as $product}
{if $product@index == 4}
<abbr title="
{/if}
{strip}
{if $product@index >= 4}
{$product.name|escape:'htmlall':'UTF-8'}
{if isset($product.attributes) && $product.attributes}
{$product.attributes|escape:'htmlall':'UTF-8'}
{/if}
{if !$product@last}
,
{else}
">…</abbr>)
{/if}
{else}
{$product.name|escape:'htmlall':'UTF-8'}
{if isset($product.attributes) && $product.attributes}
{$product.attributes|escape:'htmlall':'UTF-8'}
{/if}
{if !$product@last}
,
{else}
)
{/if}
{/if}
{/strip}
{/foreach}
{/if}
</td>
</tr>
{/if}
{/foreach}
</table>
{/if}
</div>
</div>
{/foreach}
</div>
<div class="hook_extracarrier" id="HOOK_EXTRACARRIER_{$id_address}">
{if isset($HOOK_EXTRACARRIER_ADDR) && isset($HOOK_EXTRACARRIER_ADDR.$id_address)}{$HOOK_EXTRACARRIER_ADDR.$id_address}{/if}
</div>
{foreachelse}
{assign var='errors' value=[]}
<div class="alert alert-warning" id="noCarrierWarning">
{foreach $cart->getDeliveryAddressesWithoutCarriers(true, $errors) as $address}
{if empty($address->alias)}
{l s='No carriers available.'}
{else}
{assign var='flag_error_message' value=false}
{foreach $errors as $error}
{if $error == Carrier::SHIPPING_WEIGHT_EXCEPTION}
{$flag_error_message = true}
{l s='The product selection cannot be delivered by the available carrier(s): it is too heavy. Please amend your cart to lower its weight.'}
{elseif $error == Carrier::SHIPPING_PRICE_EXCEPTION}
{$flag_error_message = true}
{l s='The product selection cannot be delivered by the available carrier(s). Please amend your cart.'}
{elseif $error == Carrier::SHIPPING_SIZE_EXCEPTION}
{$flag_error_message = true}
{l s='The product selection cannot be delivered by the available carrier(s): its size does not fit. Please amend your cart to reduce its size.'}
{/if}
{/foreach}
{if !$flag_error_message}
{l s='No carriers available for the address "%s".' sprintf=$address->alias}
{/if}
{/if}
{if !$address@last}
<br>
{/if}
{foreachelse}
{l s='No carriers available.'}
{/foreach}
</div>
{/foreach}
{/if}
</div>
<div id="extra_carrier" style="display: none;"></div>
{if $opc}
<p class="carrier_title">{l s='Leave a message'}</p>
<div>
<p>{l s='If you would like to add a comment about your order, please write it in the field below.'}</p>
<textarea class="form-control" cols="120" rows="2" name="message" id="message">{strip}
{if isset($oldMessage)}{$oldMessage|escape:'html':'UTF-8'}{/if}
{/strip}</textarea>
</div>
{/if}
{if $recyclablePackAllowed}
<p class="carrier_title">{l s='Recyclable Packaging'}</p>
<div class="checkbox recyclable">
<label for="recyclable">
<input type="checkbox" name="recyclable" id="recyclable" value="1"{if $recyclable == 1} checked="checked"{/if}>
{l s='I would like to receive my order in recycled packaging.'}
</label>
</div>
{/if}
{if $giftAllowed}
{if $opc}
<hr style="">
{/if}
<p class="carrier_title">{l s='Gift'}</p>
<div class="checkbox gift">
<label for="gift">
<input type="checkbox" name="gift" id="gift" value="1"{if $cart->gift == 1} checked="checked"{/if}>
{l s='I would like my order to be gift wrapped.'}
{if $gift_wrapping_price > 0}
<i>({l s='Additional cost of'}
<span class="price" id="gift-price">
{if $priceDisplay == 1}
{convertPrice price=$total_wrapping_tax_exc_cost}
{else}
{convertPrice price=$total_wrapping_cost}
{/if}
</span>
{if $use_taxes && $display_tax_label}
{if $priceDisplay == 1}
{l s='(tax excl.)'}
{else}
{l s='(tax incl.)'}
{/if}
{/if})
</i>
{/if}
</label>
</div>
<p id="gift_div">
<label for="gift_message">{l s='If you\'d like, you can add a note to the gift:'}</label>
<textarea rows="2" cols="120" id="gift_message" class="form-control" name="gift_message">{$cart->gift_message|escape:'html':'UTF-8'}</textarea>
</p>
{/if}
{/if}
{/if}
{if $conditions && $cms_id && !$advanced_payment_api}
{if $opc}
<hr style="">
{/if}
{if $override_tos_display }
{$override_tos_display}
{else}
<div class="box">
<div class="checkbox">
<label for="cgv">
<input type="checkbox" name="cgv" id="cgv" value="1" {if $checkedTOS}checked="checked"{/if}>
{l s='I agree to the terms of service and will adhere to them unconditionally.'}
</label>
<a href="{$link_conditions|escape:'html':'UTF-8'}" class="iframe" rel="nofollow">{l s='(Read the Terms of Service)'}</a>
</div>
</div>
{/if}
{/if}
</div>
{if !$opc}
<p class="cart_navigation clearfix">
<input type="hidden" name="step" value="3">
<input type="hidden" name="back" value="{$back}">
{if !$is_guest}
{if $back}
<a href="{$link->getPageLink('order', true, NULL, "step=1&back={$back}{if $multi_shipping}&multi-shipping={$multi_shipping}{/if}")|escape:'html':'UTF-8'}" title="{l s='Previous'}" class="btn btn-lg btn-default">
<i class="icon icon-chevron-left"></i>
{l s='Continue shopping'}
</a>
{else}
<a href="{$link->getPageLink('order', true, NULL, "step=1{if $multi_shipping}&multi-shipping={$multi_shipping}{/if}")|escape:'html':'UTF-8'}" title="{l s='Previous'}" class="btn btn-lg btn-default">
<i class="icon icon-chevron-left"></i>
{l s='Continue shopping'}
</a>
{/if}
{else}
<a href="{$link->getPageLink('order', true, NULL, "{if $multi_shipping}multi-shipping={$multi_shipping}{/if}")|escape:'html':'UTF-8'}" title="{l s='Previous'}" class="btn btn-lg btn-default">
<i class="icon icon-chevron-left"></i>
{l s='Continue shopping'}
</a>
{/if}
{if isset($virtual_cart) && $virtual_cart || (isset($delivery_option_list) && !empty($delivery_option_list))}
<button type="submit" name="processCarrier" class="btn btn-lg btn-success pull-right standard-checkout">
<span>
{l s='Proceed to checkout'}
<i class="icon icon-chevron-right"></i>
</span>
</button>
{/if}
</p>
</form>
{else}
</div>
{/if}
</div> {* end carrier_area *}
{strip}
{if !$opc}
{addJsDef orderProcess='order'}
{if isset($virtual_cart) && !$virtual_cart && $giftAllowed && $cart->gift == 1}
{addJsDef cart_gift=true}
{else}
{addJsDef cart_gift=false}
{/if}
{addJsDef orderUrl=$link->getPageLink("order", true)|escape:'quotes':'UTF-8'}
{addJsDefL name=txtProduct}{l s='Product' js=1}{/addJsDefL}
{addJsDefL name=txtProducts}{l s='Products' js=1}{/addJsDefL}
{/if}
{if $conditions}
{addJsDefL name=msg_order_carrier}{l s='You must agree to the terms of service before continuing.' js=1}{/addJsDefL}
{/if}
{/strip}