-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct-view.html
279 lines (270 loc) · 14.7 KB
/
product-view.html
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
{{inject 'outOfStockDefaultMessage' (lang 'products.out_of_stock_default_message')}}
<div class="productView"
data-event-type="product"
data-entity-id="{{product.id}}"
data-name="{{product.title}}"
data-product-category="
{{#each product.category}}
{{#if @last}}{{this}}{{else}}{{this}}, {{/if}}
{{/each}}"
data-product-brand="{{product.brand.name}}"
data-product-price="
{{#or customer (unless settings.hide_price_from_guests)}}
{{#if product.price.with_tax}}
{{product.price.with_tax.value}}
{{else}}
{{product.price.without_tax.value}}
{{/if}}
{{else}}
{{lang 'common.login_for_pricing'}}
{{/or}}"
data-product-variant="single-product-option">
{{#each product.reviews.messages}}
{{#if error}}
{{> components/common/alert/alert-error error}}
{{/if}}
{{#if success}}
{{> components/common/alert/alert-success success}}
{{/if}}
{{/each}}
<section class="productView-images" data-image-gallery>
{{!--
Note that these image sizes are coupled to image sizes used in /assets/js/theme/common/product-details.js
for variant/rule image replacement
--}}
{{#if product.images.length '>' 1 }}
{{> components/carousel-content-announcement}}
{{/if}}
<figure class="productView-image"
data-image-gallery-main
{{#if product.main_image}}
data-zoom-image="{{stripQuerystring (strReplace (getImage product.main_image) 'cdn11.bigcommerce.com/s-e7ik0oxizm' 'bryan-bigcommerce.imgix.net')}}?auto=compress,format"
{{/if}}
>
<div class="productView-img-container">
{{!-- Remove the surrounding a-element if there is no main image. --}}
{{#if product.main_image}}
<a href="{{stripQuerystring (strReplace (getImage product.main_image) 'cdn11.bigcommerce.com/s-e7ik0oxizm' 'bryan-bigcommerce.imgix.net')}}?auto=compress,format"
target="_blank">
{{/if}}
{{> components/common/responsive-img
image=product.main_image
class="productView-image--default"
fallback_size=theme_settings.product_size
lazyload=theme_settings.lazyload_mode
default_image=theme_settings.default_image_product
otherAttributes="data-main-image"
}}
{{!-- Remove the surrounding a-element if there is no main image. --}}
{{#if product.main_image}}
</a>
{{/if}}
</div>
</figure>
<ul class="productView-thumbnails"{{#gt product.images.length 5}} data-slick='{
"infinite": false,
"mobileFirst": true,
"dots": false,
"accessibility": false,
"slidesToShow": 5,
"slidesToScroll": 5
}'{{/gt}}>
{{#each product.images}}
<li class="productView-thumbnail">
<a
class="productView-thumbnail-link"
href="{{stripQuerystring (strReplace (getImage this) 'cdn11.bigcommerce.com/s-e7ik0oxizm' 'bryan-bigcommerce.imgix.net')}}?auto=compress,format"
ix-src="{{stripQuerystring (strReplace (getImage this) 'cdn11.bigcommerce.com/s-e7ik0oxizm' 'bryan-bigcommerce.imgix.net')}}?auto=compress,format"
data-image-gallery-item
data-image-gallery-new-image-url="{{stripQuerystring (strReplace (getImage this) 'cdn11.bigcommerce.com/s-e7ik0oxizm' 'bryan-bigcommerce.imgix.net')}}?auto=compress,format"
data-image-gallery-new-image-srcset="{{stripQuerystring (strReplace (getImage this) 'cdn11.bigcommerce.com/s-e7ik0oxizm' 'bryan-bigcommerce.imgix.net')}}?w=1000&auto=compress,format 1000w, {{stripQuerystring (strReplace (getImage this) 'cdn11.bigcommerce.com/s-e7ik0oxizm' 'bryan-bigcommerce.imgix.net')}}?w=500&auto=compress,format 500w, {{stripQuerystring (strReplace (getImage this) 'cdn11.bigcommerce.com/s-e7ik0oxizm' 'bryan-bigcommerce.imgix.net')}}?w=250&auto=compress,format 250w, {{stripQuerystring (strReplace (getImage this) 'cdn11.bigcommerce.com/s-e7ik0oxizm' 'bryan-bigcommerce.imgix.net')}}?w=100&auto=compress,format 100w"
data-image-gallery-zoom-image-url="{{stripQuerystring (strReplace (getImage this) 'cdn11.bigcommerce.com/s-e7ik0oxizm' 'bryan-bigcommerce.imgix.net')}}?auto=compress,format"
>
{{> components/common/responsive-img
image=this
fallback_size=../theme_settings.productview_thumb_size
lazyload=../theme_settings.lazyload_mode
}}
</a>
</li>
{{/each}}
</ul>
</section>
<section class="productView-details product-data">
<div class="productView-product">
<h1 class="productView-title">{{product.title}}</h1>
{{#if product.brand}}
<h2 class="productView-brand">
<a href="{{product.brand.url}}"><span>{{product.brand.name}}</span></a>
</h2>
{{/if}}
{{#if product.call_for_price}}
<p class="productView-price">
<span>{{product.call_for_price}}</span>
</p>
{{/if}}
<div class="productView-price">
{{#or customer (unless settings.hide_price_from_guests)}}
{{> components/products/price price=product.price}}
{{else}}
{{> components/common/login-for-pricing}}
{{/or}}
</div>
{{{region name="product_below_price"}}}
<div class="productView-rating">
{{#if settings.show_product_rating}}
{{> components/products/ratings rating=product.rating}}
{{#if product.num_reviews '>' 0}}
<a href="{{product.url}}{{#if is_ajax}}#product-reviews{{/if}}" id="productReview_link">
{{lang 'products.reviews.link_to_review' total=product.num_reviews}}
</a>
{{else}}
<span>{{lang 'products.reviews.link_to_review' total=product.num_reviews}}</span>
{{/if}}
{{/if}}
{{#if settings.show_product_reviews}}
<a href="{{product.url}}{{#if is_ajax}}#write_review{{/if}}"
class="productView-reviewLink productView-reviewLink--new"
{{#unless is_ajax}}data-reveal-id="modal-review-form"{{/unless}}
role="button"
>
{{lang 'products.reviews.new'}}
</a>
{{#unless is_ajax}}
{{> components/products/modals/writeReview}}
{{/unless}}
{{/if}}
</div>
{{product.detail_messages}}
<dl class="productView-info">
<dt class="productView-info-name sku-label"{{#unless product.sku}} style="display: none;"{{/unless}}>{{lang 'products.sku'}}</dt>
<dd class="productView-info-value" data-product-sku>{{product.sku}}</dd>
<dt class="productView-info-name upc-label"{{#unless product.upc}} style="display: none;"{{/unless}}>{{lang 'products.upc'}}</dt>
<dd class="productView-info-value" data-product-upc>{{product.upc}}</dd>
{{#if product.condition}}
<dt class="productView-info-name">{{lang 'products.condition'}}</dt>
<dd class="productView-info-value">{{product.condition}}</dd>
{{/if}}
{{#if product.availability}}
<dt class="productView-info-name">{{lang 'products.availability'}}</dt>
<dd class="productView-info-value">{{product.availability}}</dd>
{{/if}}
{{#all product.weight theme_settings.show_product_weight}}
<dt class="productView-info-name">{{lang 'products.weight'}}</dt>
<dd class="productView-info-value" data-product-weight>{{product.weight}}</dd>
{{/all}}
{{#all product.width product.height product.depth theme_settings.show_product_dimensions}}
<dt class="productView-info-name">{{lang 'products.width'}}</dt>
<dd class="productView-info-value" data-product-width>
{{product.width}}
{{#if settings.measurements.length '==' 'Centimeters'}}
({{lang 'products.measurement.metric'}})
{{else}}
({{lang 'products.measurement.imperial'}})
{{/if}}
</dd>
<dt class="productView-info-name">{{lang 'products.height'}}</dt>
<dd class="productView-info-value" data-product-height>
{{product.height}}
{{#if settings.measurements.length '==' 'Centimeters'}}
({{lang 'products.measurement.metric'}})
{{else}}
({{lang 'products.measurement.imperial'}})
{{/if}}
</dd>
<dt class="productView-info-name">{{lang 'products.depth'}}</dt>
<dd class="productView-info-value" data-product-depth>
{{product.depth}}
{{#if settings.measurements.length '==' 'Centimeters'}}
({{lang 'products.measurement.metric'}})
{{else}}
({{lang 'products.measurement.imperial'}})
{{/if}}
</dd>
{{/all}}
{{#if product.min_purchase_quantity}}
<dt class="productView-info-name">{{lang 'products.min_purchase_quantity'}}</dt>
<dd class="productView-info-value">{{lang 'products.purchase_units' quantity=product.min_purchase_quantity}}</dd>
{{/if}}
{{#if product.max_purchase_quantity}}
<dt class="productView-info-name">{{lang 'products.max_purchase_quantity'}}</dt>
<dd class="productView-info-value">{{lang 'products.purchase_units' quantity=product.max_purchase_quantity}}</dd>
{{/if}}
{{#if product.gift_wrapping_available}}
<dt class="productView-info-name">{{lang 'products.gift_wrapping'}}</dt>
<dd class="productView-info-value">{{lang 'products.gift_wrapping_available'}}</dd>
{{/if}}
{{#if product.shipping}}
{{#if product.shipping.calculated}}
<dt class="productView-info-name">{{lang 'products.shipping'}}</dt>
<dd class="productView-info-value">{{lang 'products.shipping_calculated'}}</dd>
{{else}}
{{#if product.shipping.price.value '===' 0}}
<dt class="productView-info-name">{{lang 'products.shipping'}}</dt>
<dd class="productView-info-value">{{lang 'products.shipping_free'}}</dd>
{{else}}
<dt class="productView-info-name">{{lang 'products.shipping'}}</dt>
<dd class="productView-info-value">{{lang 'products.shipping_fixed' amount=product.shipping.price.formatted}}</dd>
{{/if}}
{{/if}}
{{/if}}
{{#if settings.bulk_discount_enabled}}
<div class="productView-info-bulkPricing">
{{> components/products/bulk-discount-rates bulk_discount_rates=product.bulk_discount_rates}}
</div>
{{/if}}
{{#if theme_settings.show_custom_fields_tabs '!==' true}}
{{> components/products/custom-fields }}
{{/if}}
</dl>
</div>
</section>
<section class="productView-details product-options">
<div class="productView-options">
{{#if product.release_date }}
<p>{{product.release_date}}</p>
{{/if}}
<form class="form" method="post" action="{{product.cart_url}}" enctype="multipart/form-data"
data-cart-item-add>
<input type="hidden" name="action" value="add">
<input type="hidden" name="product_id" value="{{product.id}}"/>
<div data-product-option-change style="display:none;">
{{inject 'showSwatchNames' theme_settings.show_product_swatch_names}}
{{#each product.options}}
{{{dynamicComponent 'components/products/options'}}}
{{/each}}
</div>
<div class="form-field form-field--stock{{#unless product.stock_level}} u-hiddenVisually{{/unless}}">
<label class="form-label form-label--alternate">
{{lang 'products.current_stock'}}
<span data-product-stock>{{product.stock_level}}</span>
</label>
</div>
{{> components/products/add-to-cart with_wallet_buttons=true}}
{{#if product.out_of_stock}}
{{#if product.out_of_stock_message}}
{{> components/common/alert/alert-error product.out_of_stock_message}}
{{else}}
{{> components/common/alert/alert-error (lang 'products.sold_out')}}
{{/if}}
{{/if}}
</form>
{{#if settings.show_wishlist}}
{{> components/common/wishlist-dropdown}}
{{/if}}
</div>
{{> components/common/share url=product.url}}
</section>
<article class="productView-description">
{{#if theme_settings.show_product_details_tabs}}
{{> components/products/description-tabs}}
{{else}}
{{> components/products/description}}
{{/if}}
</article>
</div>
<div id="previewModal" class="modal modal--large" data-reveal>
{{> components/common/modal/modal-close-btn }}
<div class="modal-content"></div>
<div class="loadingOverlay"></div>
</div>