-
Notifications
You must be signed in to change notification settings - Fork 27
/
products-comparison.tpl
212 lines (198 loc) · 10.3 KB
/
products-comparison.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
{assign var='taxes_behavior' value=false}
{if $use_taxes && (!$priceDisplay || $priceDisplay == 2)}
{assign var='taxes_behavior' value=true}
{/if}
{capture name=path}{l s='Product Comparison'}{/capture}
<h1 class="page-heading">{l s='Product Comparison'}</h1>
{if $hasProduct}
<div class="table-responsive">
<table id="product_comparison" class="table table-hover table-bordered text-center">
<tr>
<td >{$HOOK_COMPARE_EXTRA_INFORMATION}</td>
{foreach from=$products item=product}
<td>
<div class="clearfix">
<button class="close" href="{$link->getPageLink('products-comparison', true)|escape:'html':'UTF-8'}" title="{l s='Remove'}" data-id-product="{$product->id}">×</button>
</div>
<div class="product-image-container">
<a class="product_image" href="{$product->getLink()|escape:'html':'UTF-8'}" title="{$product->name|escape:'html':'UTF-8'}">
{if !empty($lazy_load)}
<noscript>
<img src="{$link->getImageLink($product->link_rewrite, $product->id_image, 'home_default', null, ImageManager::retinaSupport())|escape:'html':'UTF-8'}"
width="{getWidthSize|intval type='home_default'}"
height="{getHeightSize|intval type='home_default'}"
>
</noscript>
{/if}
<picture class="img-responsive center-block{if !empty($lazy_load)} tb-lazy-image{/if}">
<!--[if IE 9]><video style="display: none;"><![endif]-->
{if !empty($webp)}
<source {if !empty($lazy_load)}srcset="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII= 1w" data-{/if}srcset="{$link->getImageLink($product->link_rewrite, $product->id_image, 'home_default', 'webp', ImageManager::retinaSupport())|escape:'html':'UTF-8'}"
type="image/webp"
>
{/if}
<!--[if IE 9]></video><![endif]-->
<img {if !empty($lazy_load)}srcset="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII= 1w" data-{/if}srcset="{$link->getImageLink($product->link_rewrite, $product->id_image, 'home_default', null, ImageManager::retinaSupport())|escape:'html':'UTF-8'}"
{if !empty($lazy_load)}src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="{/if}
width="{getWidthSize|intval type='home_default'}"
height="{getHeightSize|intval type='home_default'}"
>
</picture>
</a>
<div class="product-label-container">
{if (!$PS_CATALOG_MODE AND ((isset($product->show_price) && $product->show_price) || (isset($product->available_for_order) && $product->available_for_order)))}
{if isset($product->online_only) && $product->online_only}
<span class="product-label product-label-online">{l s='Online only'}</span>
{/if}
{/if}
{if isset($product->new) && $product->new == 1}
<span class="product-label product-label-new">{l s='New'}</span>
{/if}
{if isset($product->on_sale) && $product->on_sale && isset($product->show_price) && $product->show_price && !$PS_CATALOG_MODE}
<span class="product-label product-label-sale">{l s='Sale!'}</span>
{elseif isset($product->reduction) && $product->reduction && isset($product->show_price) && $product->show_price && !$PS_CATALOG_MODE}
<span class="product-label product-label-discount">{l s='Reduced price!'}</span>
{/if}
</div>
</div>
</td>
{/foreach}
</tr>
<tr>
<td></td>
{foreach from=$products item=product}
<td>
<h4>
<a href="{$product->getLink()|escape:'html':'UTF-8'}" title="{$product->name|escape:'html':'UTF-8'}">
{$product->name|escape:'html':'UTF-8'}
</a>
</h4>
</td>
{/foreach}
</tr>
<tr>
<td></td>
{foreach from=$products item=product}
<td>
{if isset($product->show_price) && $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE}
<span class="price product-price">{convertPrice price=$product->getPrice($taxes_behavior)}</span>
{hook h="displayProductPriceBlock" id_product=$product->id type="price"}
{if isset($product->specificPrice) && $product->specificPrice}
{if {$product->specificPrice.reduction_type == 'percentage'}}
<span class="old-price product-price">{displayWtPrice p=($product->getPrice(true, null, 6, null, false, false))}</span>
<span class="price-percent-reduction">-{$product->specificPrice.reduction*100|floatval}%</span>
{else}
<span class="old-price product-price">{convertPrice price=($product->getPrice($taxes_behavior) + $product->specificPrice.reduction)}</span>
<span class="price-percent-reduction">-{convertPrice price=$product->specificPrice.reduction}</span>
{/if}
{hook h="displayProductPriceBlock" product=$product type="old_price"}
{/if}
{hook h="displayProductPriceBlock" product=$product type="price"}
{if $product->on_sale}
{elseif $product->specificPrice AND $product->specificPrice.reduction}
<div class="product_discount">
<span class="special-price">{l s='Reduced price!'}</span>
</div>
{/if}
{if !empty($product->unity) && $product->unit_price_ratio > 0.000000}
{math equation="pprice / punit_price" pprice=$product->getPrice($taxes_behavior) punit_price=$product->unit_price_ratio assign=unit_price}
<span class="comparison_unit_price">
{convertPrice price=$unit_price} {l s='per %s' sprintf=$product->unity|escape:'html':'UTF-8'}
</span>
{hook h="displayProductPriceBlock" product=$product type="unit_price"}
{else}
{/if}
{/if}
</td>
{/foreach}
</tr>
<tr>
<td></td>
{foreach from=$products item=product}
<td class="td-product-description">
{if !empty($product->description_short)}
<div class="rte">{$product->description_short}</div>
{/if}
</td>
{/foreach}
</tr>
<tr>
<td></td>
{foreach from=$products item=product}
<td>
{if !(($product->quantity <= 0 && !$product->available_later) OR ($product->quantity != 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE)}
<span class="availability_label">{l s='Availability:'}</span>
<span class="availability_value label {if $product->quantity <= 0}label-warning{else}label-success{/if}">
{if $product->quantity <= 0}
{if $product->allow_oosp}
{$product->available_later|escape:'html':'UTF-8'}
{else}
{l s='This product is no longer in stock.'}
{/if}
{else}
{$product->available_now|escape:'html':'UTF-8'}
{/if}
</span>
{/if}
{if !$product->is_virtual}{hook h="displayProductDeliveryTime" product=$product}{/if}
{hook h="displayProductPriceBlock" product=$product type="weight"}
</td>
{/foreach}
</tr>
<tr>
<td></td>
{foreach from=$products item=product}
<td>
{if (!$product->hasAttributes() OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product->minimal_quantity == 1 AND $product->customizable != 2 AND !$PS_CATALOG_MODE}
{if ($product->quantity > 0 OR $product->allow_oosp)}
<a class="ajax_add_to_cart_button btn btn-primary" data-id-product="{$product->id}" href="{$link->getPageLink('cart', true, NULL, "qty=1&id_product={$product->id}&token={$static_token}&add")|escape:'html':'UTF-8'}" title="{l s='Add to cart'}">
{l s='Add to cart'}
</a>
{else}
<span class="ajax_add_to_cart_button btn btn-primary disabled">{l s='Add to cart'}</span>
{/if}
{/if}
<a class="btn btn-default" href="{$product->getLink()|escape:'html':'UTF-8'}" title="{l s='View'}">{l s='View'}</a>
</td>
{/foreach}
</tr>
{if $ordered_features}
<tr class="text-center active">
<td class="td_empty">{l s='Features:'}</td>
<td colspan="{$products|count}"></td>
</tr>
{foreach from=$ordered_features item=feature}
<tr>
<td class="feature-name">{$feature.name|escape:'html':'UTF-8'}</td>
{foreach from=$products item=product}
{assign var='product_id' value=$product->id}
{assign var='feature_id' value=$feature.id_feature}
<td class="comparison_infos">
{if isset($product_features[$product_id]) && isset($product_features[$product_id][$feature_id])}
{$product_features[$product_id][$feature_id]|escape:'html':'UTF-8'}
{/if}
</td>
{/foreach}
</tr>
{/foreach}
{else}
<tr>
<td></td>
<td colspan="{$products|count}" class="text-center">{l s='No features to compare'}</td>
</tr>
{/if}
{$HOOK_EXTRA_PRODUCT_COMPARISON}
</table>
</div>
{else}
<div class="alert alert-warning">{l s='There are no products selected for comparison.'}</div>
{/if}
<nav>
<ul class="pager">
<li class="previous">
<a href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}">
{if $isRtl}→{else}←{/if} {l s='Continue Shopping'}
</a>
</li>
</ul>
</nav>