/
preview.html.twig
186 lines (176 loc) · 7.5 KB
/
preview.html.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
{#**
* 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 Open Software License (OSL 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/OSL-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/OSL-3.0 Open Software License (OSL 3.0)
*#}
{% block order_preview %}
<div class="row order-preview-content mt-2" data-role="preview-row">
<div class="col-5">
<div class="row">
<div class="col">
<div class="row">
<div class="col-1">
<p class="mb-0">
<i class="material-icons pr-1">local_shipping</i>
</p>
</div>
<div class="col" data-role="shipping-details">
<p class="mb-0">
<strong>{{ 'Carrier'|trans({}, 'Admin.Global') }}:</strong>
{% if not orderPreview.isVirtual %}
{{ orderPreview.shippingDetails.carrierName }}
{% else %}
-
{% endif %}
</p>
<p class="mb-0">
<strong>{{ 'Tracking number'|trans({}, 'Admin.Shipping.Feature') }}:</strong>
{% if not orderPreview.isVirtual and orderPreview.shippingDetails.trackingNumber is not empty %}
{% if orderPreview.shippingDetails.trackingUrl %}
<a href="{{ orderPreview.shippingDetails.trackingUrl }}" target="_blank" rel="noopener noreferrer nofollow">{{ orderPreview.shippingDetails.trackingNumber }}</a>
{% else %}
{{ orderPreview.shippingDetails.trackingNumber }}
{% endif %}
{% else %}
-
{% endif %}
</p>
<p class="mb-2">
<strong>{{ 'Shipping details'|trans({}, 'Admin.Orderscustomers.Feature') }}:</strong>
{% if orderPreview.virtual %}
-
{% endif %}
</p>
{% if not orderPreview.virtual %}
{% for line in orderPreview.shippingAddressFormatted|split("\n") %}
<p{% if not loop.last %} class="mb-0"{% endif %}>{{ line }}</p>
{% endfor %}
{% endif %}
</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col-1">
<p class="mb-0">
<i class="material-icons pr-1">email</i>
</p>
</div>
<div class="col" data-role="email">
<p class="mb-1">
<strong>{{ 'Email:'|trans({}, 'Admin.Global') }}</strong>
</p>
<p class="mb-0">{{ orderPreview.invoiceDetails.email }}</p>
</div>
</div>
<div class="row">
<div class="col-1">
<p class="mb-0">
<i class="material-icons pr-1">receipt</i>
</p>
</div>
<div class="col" data-role="invoice-details">
<p class="mb-1">
<strong>{{ 'Invoice details'|trans({}, 'Admin.Orderscustomers.Feature') }}:</strong>
</p>
{% for line in orderPreview.invoiceAddressFormatted|split("\n") %}
<p{% if not loop.last %} class="mb-0"{% endif %}>{{ line }}</p>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
<div class="col-7">
<div class="table-responsive">
<table class="table product table-borderless border-bottom-0" data-role="product-table">
<thead>
<tr>
{% if orderPreview.taxIncluded %}
{% set taxInclusion = 'Tax included'|trans({}, 'Admin.Global') %}
{% else %}
{% set taxInclusion = 'Tax excluded'|trans({}, 'Admin.Global') %}
{% endif %}
<th>
{{ 'Products'|trans({}, 'Admin.Global') }}
({{ orderPreview.productDetails|length }})
</th>
<th>{{ 'Reference'|trans({}, 'Admin.Global') }}</th>
<th class="js-cell-product-stock-location">{{ 'Stock location'|trans({}, 'Admin.Orderscustomers.Feature') }}</th>
{% if orderPreview.taxIncluded == false %}
<th class="text-center">
{{ 'Tax'|trans({}, 'Admin.Global') }}
</th>
{% endif %}
<th class="text-center">{{ 'Quantity'|trans({}, 'Admin.Global') }}</th>
<th class="text-center">
{{ 'Total'|trans({}, 'Admin.Global') }}
<small>{{ taxInclusion }}</small>
</th>
</tr>
</thead>
<tbody>
{% for productDetail in orderPreview.productDetails %}
<tr class="{% if loop.index > productsPreviewLimit %}js-product-preview-more d-none{% endif %}">
<td class="p-1">
{% if productDetail.id %}
<a class="px-0 external-link" href="{{ path('admin_product_form', {'id': productDetail.id}) }}" target="_blank">{{ productDetail.name }}</a>
{% else %}
{{ productDetail.name }} ({{ 'Product deleted'|trans({}, 'Admin.Catalog.Feature') }})
{% endif %}
</td>
<td class="p-1">{{ productDetail.reference }}</td>
<td class="p-1 js-cell-product-stock-location">
{% if productDetail.location is not empty %}{{ productDetail.location }}{% endif %}
</td>
{% if orderPreview.taxIncluded == false %}
<td class="p-1 text-center">{{ productDetail.totalTax }}</td>
{% endif %}
<td class="p-1 text-center">{{ productDetail.quantity }}</td>
<td class="p-1 text-center">{{ productDetail.totalPrice }}</td>
</tr>
{% endfor %}
{% if orderPreview.productDetails|length > productsPreviewLimit %}
<tr>
<td colspan="6">
<a href="#" class="js-preview-more-products-btn text-dark">
<i class="material-icons">more_horiz</i>
{{ '(%count% more)'|trans({
'%count%': orderPreview.productDetails|length - productsPreviewLimit
}, 'Admin.Global') }}
</a>
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
<div class="text-right">
<a href="{{ path('admin_orders_view', {'orderId': orderId}) }}" class="btn btn-primary btn-sm mb-3">
{{ 'Open details'|trans({}, 'Admin.Orderscustomers.Feature') }}
<i class="material-icons rtl-flip">arrow_right_alt</i>
</a>
</div>
</div>
</div>
{{ renderhook('displayOrderPreview', {'order_id': orderId}) }}
{% endblock %}