/
addresses.tpl
137 lines (122 loc) · 5.82 KB
/
addresses.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
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
{extends file='checkout/_partials/steps/checkout-step.tpl'}
{block name='step_content'}
<div class="js-address-form">
<form
method="POST"
data-id-address="{$id_address}"
action="{url entity='order' params=['id_address' => $id_address]}"
data-refresh-url="{url entity='order' params=['ajax' => 1, 'action' => 'addressForm']}"
>
{if $use_same_address}
<p>
{if $cart.is_virtual}
{l s='The selected address will be used as your personal address (for invoice).' d='Shop.Theme.Checkout'}
{else}
{l s='The selected address will be used both as your personal address (for invoice) and as your delivery address.' d='Shop.Theme.Checkout'}
{/if}
</p>
{else}
<h2 class="h4">{l s='Shipping Address' d='Shop.Theme.Checkout'}</h2>
{/if}
{if $show_delivery_address_form}
<div id="delivery-address">
{render file = 'checkout/_partials/address-form.tpl'
ui = $address_form
use_same_address = $use_same_address
type = "delivery"
form_has_continue_button = $form_has_continue_button
}
</div>
{elseif $customer.addresses|count > 0}
<div id="delivery-addresses" class="address-selector js-address-selector">
{include file = 'checkout/_partials/address-selector-block.tpl'
addresses = $customer.addresses
name = "id_address_delivery"
selected = $id_address_delivery
type = "delivery"
interactive = !$show_delivery_address_form and !$show_invoice_address_form
}
</div>
{if isset($delivery_address_error)}
<p class="alert alert-danger js-address-error" name="alert-delivery" id="id-failure-address-{$delivery_address_error.id_address}">{$delivery_address_error.exception}</p>
{else}
<p class="alert alert-danger js-address-error" name="alert-delivery" style="display: none">{l s="Your address is incomplete, please update it." d="Shop.Notifications.Error"}</p>
{/if}
<p class="add-address">
<a href="{$new_address_delivery_url}"><i class="material-icons"></i>{l s='add new address' d='Shop.Theme.Actions'}</a>
</p>
{if $use_same_address && !$cart.is_virtual}
<p>
<a data-link-action="different-invoice-address" href="{$use_different_address_url}">
{l s='Billing address differs from shipping address' d='Shop.Theme.Checkout'}
</a>
</p>
{/if}
{/if}
{if !$use_same_address}
<h2 class="h4">{l s='Your Invoice Address' d='Shop.Theme.Checkout'}</h2>
{if $show_invoice_address_form}
<div id="invoice-address">
{render file = 'checkout/_partials/address-form.tpl'
ui = $address_form
use_same_address = $use_same_address
type = "invoice"
form_has_continue_button = $form_has_continue_button
}
</div>
{else}
<div id="invoice-addresses" class="address-selector js-address-selector">
{include file = 'checkout/_partials/address-selector-block.tpl'
addresses = $customer.addresses
name = "id_address_invoice"
selected = $id_address_invoice
type = "invoice"
interactive = !$show_delivery_address_form and !$show_invoice_address_form
}
</div>
{if isset($invoice_address_error)}
<p class="alert alert-danger js-address-error" name="alert-invoice" id="id-failure-address-{$invoice_address_error.id_address}">{$invoice_address_error.exception}</p>
{else}
<p class="alert alert-danger js-address-error" name="alert-invoice" style="display: none">{l s="Your address is incomplete, please update it." d="Shop.Notifications.Error"}</p>
{/if}
<p class="add-address">
<a href="{$new_address_invoice_url}"><i class="material-icons"></i>{l s='add new address' d='Shop.Theme.Actions'}</a>
</p>
{/if}
{/if}
{if !$form_has_continue_button}
<div class="clearfix">
<button type="submit" class="btn btn-primary continue float-xs-right" name="confirm-addresses" value="1">
{l s='Continue' d='Shop.Theme.Actions'}
</button>
<input type="hidden" id="not-valid-addresses" class="js-not-valid-addresses" value="{$not_valid_addresses}">
</div>
{/if}
</form>
{hook h='displayAddressSelectorBottom'}
</div>
{/block}