Advertisement
Bubalina

product page

Jul 14th, 2021
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.38 KB | None | 0 0
  1. <!-- /snippets/product-template.liquid -->
  2. <meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
  3. <meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}">
  4. {% if template.name == "index" %}
  5. <meta itemprop="sku" content="{{ product.variants.first.sku }}">
  6. <meta itemprop="gtin12" content="{{ product.variants.first.barcode }}">
  7. <div itemprop="review" {% comment remove microdata structured data %}itemscope{% endcomment %} itemtype="http://schema.org/Review">
  8. <div itemprop="reviewRating" {% comment remove microdata structured data %}itemscope{% endcomment %} itemtype="http://schema.org/Rating">
  9. <meta itemprop="ratingValue" content="4.9">
  10. <meta itemprop="bestRating" content="5">
  11. </div>
  12. <div itemprop="author" {% comment remove microdata structured data %}itemscope{% endcomment %} itemtype="http://schema.org/Person">
  13. <meta itemprop="name" content="The Peoples Mask">
  14. </div>
  15. </div>
  16. <div itemprop="aggregateRating" {% comment remove microdata structured data %}itemscope{% endcomment %} itemtype="http://schema.org/AggregateRating">
  17. <meta itemprop="ratingValue" content="4.9">
  18. <meta itemprop="reviewCount" content="89">
  19. </div>
  20. {% endif %}
  21.  
  22. {% assign current_variant = product.selected_or_first_available_variant %}
  23. {% assign featured_image = current_variant.featured_image | default: product.featured_image %}
  24.  
  25. {% assign on_sale = false %}
  26.  
  27. {% if current_variant.compare_at_price > current_variant.price %}
  28. {% assign on_sale = true %}
  29. {% endif %}
  30.  
  31. {% assign sold_out = true %}
  32.  
  33. {% if current_variant.available %}
  34. {% assign sold_out = false %}
  35. {% endif %}
  36.  
  37. {% capture variantStatus %}
  38. {% if sold_out == true %}
  39. variant-soldout
  40. {% else %}
  41. variant-available
  42. {% endif %}
  43. {% endcapture %}
  44.  
  45. {%- assign enable_zoom = section.settings.enable_zoom -%}
  46. {%- assign product_image_zoom_size = '1024x1024' -%}
  47. {%- assign product_image_scale = '2' -%}
  48.  
  49. {% capture product_header_layout %}
  50. {% if section.settings.product_vendor %}
  51. <p class="product-single__vendor vendor" itemprop="brand">{{ product.vendor }}</p>
  52. {% endif %}
  53.  
  54. {% if settings.review_badge == 'review_badge_above' %}
  55. {% include 'review-badge', badge_template: 'product' %}
  56. {% endif %}
  57.  
  58. <h1 class="product-single__title {% if section.settings.product_title_size %}product-title-big {% endif %}" itemprop="name">
  59. {% if template != "product" %}
  60. <a {% unless section_onboarding %} href="{{ product.url }}?variant={{ current_variant.id }}"{% endunless %}>
  61. {% endif %}
  62.  
  63. {% unless section_onboarding %}
  64. {{ product.title }}
  65. {% else %}
  66. {{ title }}
  67. {% endunless %}
  68.  
  69. {% if template != "product" %}
  70. </a>
  71. {% endif %}
  72. </h1>
  73.  
  74. {% if settings.review_badge == 'review_badge_under' %}
  75. {% include 'review-badge', badge_template: 'product' %}
  76. {% endif %}
  77. {% endcapture %}
  78.  
  79. <div class="product-single{% if section.settings.product_photo_alignement == 'right' %} product-photos-right{% endif %}">
  80. <div class="box">
  81. <div class="wrapper">
  82. <div class="grid product-wrapper">
  83.  
  84. <!-- images -->
  85. <div class="product-photos grid__item medium--six-twelfths large--seven-twelfths
  86. {% if section.settings.image_layout == "stacked" %}layout-stacked
  87. {% elsif section.settings.image_layout == "thumbnail" %}layout-thumbnail {% endif %}
  88. mobile-image-{{ section.settings.mobile_image }}">
  89.  
  90. <div class="medium--hide large--hide text-center">
  91. {{ product_header_layout }}
  92. </div>
  93.  
  94. <div class="product-single__photos slick-format slick-format-sm
  95. {% if section.settings.image_layout == "stacked" %}product-stacked__photos
  96. {% elsif section.settings.image_layout == "thumbnail" %}product-thumbnail__photos{% endif %}">
  97.  
  98. {% if section_onboarding %}
  99. {{ 'product-1' | placeholder_svg_tag: 'placeholder-svg' }}
  100. {% else %}
  101. {% capture img_id_class %}product-single__photo-{{ featured_image.id }}{% endcapture %}
  102. {% capture zoom_img_id %}FeaturedImageZoom-{{ featured_image.id }}-{{ image.id }}{% endcapture %}
  103. {% capture wrapper_id %}ProductImageWrapper-{{ featured_image.id }}{% endcapture %}
  104.  
  105. {% comment %}
  106. Display current variant image
  107. {% endcomment %}
  108. <div class="product-single__photo--flex-wrapper">
  109. <div class="product-single__photo--flex">
  110. <div id="{{ wrapper_id }}" class="product-single__photo--container {% if section.settings.image_layout == "thumbnail" %}product-single__photo--container-thumb{% endif %}">
  111. <div id="{{ zoom_img_id }}"
  112. class="product-single__photo-wrapper image-wrapper {% if enable_zoom %} js-zoom-enabled{% endif %}"
  113. {% if enable_zoom %} data-zoom="{{ featured_image | img_url: product_image_zoom_size, scale: product_image_scale }}"{% endif %}
  114. style="padding-top:{{ 1 | divided_by: featured_image.aspect_ratio | times: 100}}%;"
  115. data-image-id="{{ featured_image.id }}">
  116. {% assign img_url = featured_image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' %}
  117. <img class="product-single__photo image lazyload {{ img_id_class }}"
  118. src="{{ featured_image | img_url: '300x300' }}"
  119. data-src="{{ img_url }}"
  120. data-widths="[180, 360, 590, 720, 900, 1080, 1296, 1512, 1728, 2048]"
  121. data-aspectratio="{{ featured_image.aspect_ratio }}"
  122. data-sizes="auto"
  123. data-image-id="{{ featured_image.id }}"
  124. alt="{{ featured_image.alt | escape }}">
  125.  
  126. <noscript>
  127. <img class="product-single__photo"
  128. src="{{ featured_image | img_url: 'master' }}"
  129. alt="{{ featured_image.alt | escape }}" data-image-id="{{ featured_image.id }}">
  130. </noscript>
  131. </div>
  132.  
  133. </div>
  134. </div>
  135. </div>
  136. {% endif %}
  137.  
  138. {% comment %}
  139. Display variant image
  140. {% endcomment %}
  141.  
  142. {% for image in product.images %}
  143. {% unless image contains featured_image %}
  144. {% capture img_id_class %}product-single__photo-{{ image.id }}{% endcapture %}
  145. {% capture zoom_img_id %}FeaturedImageZoom-{{ section.id }}-{{ image.id }}{% endcapture %}
  146. {% capture wrapper_id %}ProductImageWrapper-{{ image.id }}{% endcapture %}
  147.  
  148. <div class="product-single__photo--flex-wrapper not-featured-image">
  149. <div class="product-single__photo--flex">
  150. <div id="{{ wrapper_id }}" class="product-single__photo--container{% if section.settings.image_layout == "thumbnail" %} product-single__photo--container-thumb{% endif %}">
  151. <div id="{{ zoom_img_id }}"
  152. class="product-single__photo-wrapper image-wrapper {% if enable_zoom %} js-zoom-enabled{% endif %}"
  153. {% if enable_zoom %} data-zoom="{{ image | img_url: product_image_zoom_size, scale: product_image_scale }}"{% endif %}
  154. style="padding-top:{{ 1 | divided_by: image.aspect_ratio | times: 100}}%;"
  155. data-image-id="{{ image.id }}">
  156. {% assign img_url = image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' %}
  157. <img class="product-single__photo image lazyload {{ img_id_class }}"
  158. src="{{ image | img_url: '300x' }}"
  159. data-src="{{ img_url }}"
  160. data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]"
  161. data-aspectratio="{{ image.aspect_ratio }}"
  162. data-sizes="auto"
  163. data-image-id="{{ image.id }}"
  164. alt="{{ image.alt | escape }}">
  165.  
  166. <noscript>
  167. <img class="product-single__photo" src="{{ image.src | img_url: 'master' }}"
  168. alt="{{ image.alt | escape }}"
  169. data-image-id="{{ image.id }}">
  170. </noscript>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. {% endunless %}
  176. {% endfor %}
  177. </div>
  178.  
  179. {% if product.images.size > 1 %}
  180. <div class="product-single__thumbnails slick-format slick-format-sm grid grid--small {% if product.images.size < 6 %}slick-disabled{% endif %}" id="ProductThumbs">
  181. <div class="grid__item one-fifth">
  182. <a class="product-single__thumbnail">
  183. <img class="product-single__thumb" src="{{ featured_image.src | img_url: '150x150', crop: 'center' }}" alt="{{ featured_image.alt | escape }}">
  184. </a>
  185. </div>
  186. {% for image in product.images %}
  187. {% unless image contains featured_image %}
  188. <div class="grid__item one-fifth">
  189. <a class="product-single__thumbnail">
  190. <img class="product-single__thumb" src="{{ image.src | img_url: '150x150', crop: 'center' }}" alt="{{ image.alt | escape }}">
  191. </a>
  192. </div>
  193. {% endunless %}
  194. {% endfor %}
  195. </div>
  196. {% endif %}
  197. {% include "dbtfy-product-video" %}</div>
  198.  
  199. <!-- product details -->
  200. <div data-upsell-target-id="{{ product.id }}" class="product-details grid__item medium--six-twelfths large--five-twelfths {{variantStatus}}">
  201. <div class="product-single__meta">
  202.  
  203. <div class="small--hide {{ section.settings.product_header_alignement }}">
  204. {{ product_header_layout }}
  205. </div>
  206.  
  207. <div itemprop="offers" {% comment remove microdata structured data %}itemscope{% endcomment %} itemtype="http://schema.org/Offer">
  208.  
  209. <div class="price-wrapper {{ section.settings.product_header_alignement }}" data-price-container>
  210. {% if section_onboarding %}
  211. <span id="ProductPrice"
  212. class="product-single__price"
  213. itemprop="price"
  214. content="{{ price | divided_by: 100.00 }}">
  215. {{ price | money }}
  216. </span>
  217. {% else %}
  218. {% if on_sale %}
  219. <span id="PriceA11y" class="visually-hidden" {% if sold_out %}aria-hidden="true"{% endif %}>{{ 'products.general.regular_price' | t }}</span>
  220. <span class="product-single__price--wrapper" aria-hidden="false">
  221. <span id="ComparePrice" class="price-compare product-single__price--compare-at">
  222. {{ current_variant.compare_at_price | money }}
  223. </span>
  224. </span>
  225. <span id="ComparePriceA11y" class="visually-hidden" aria-hidden="false">{{ 'products.general.sale_price' | t }}</span>
  226. {% else %}
  227. <span id="PriceA11y" class="visually-hidden" {% if sold_out %}aria-hidden="true"{% endif %}>{{ 'products.general.regular_price' | t }}</span>
  228. <span class="product-single__price--wrapper hide" aria-hidden="true">
  229. <span id="ComparePrice" class="price-compare product-single__price--compare-at"></span>
  230. </span>
  231. <span id="ComparePriceA11y" class="visually-hidden" aria-hidden="true">{{ 'products.general.sale_price' | t }}</span>
  232. {% endif %}
  233.  
  234. <span id="ProductPrice"
  235. class="product-single__price{% if on_sale %} on-sale{% endif %}"
  236. itemprop="price"
  237. content="{{ current_variant.price | divided_by: 100.00 }}"
  238. {% unless current_variant.available %}aria-hidden="true"{% endunless %}>
  239. {{ current_variant.price | money }}
  240. </span>{% include "dbtfy-discount-saved" %}
  241. {% endif %}
  242. {% if settings.position_currency_converter == "product" %}{% include "currency-selector" %}{% endif %}
  243. </div>
  244.  
  245. {% include "dbtfy-inventory-quantity" %}{% include "dbtfy-live-view" %}{% include "dbtfy-delivery-time" %}<meta itemprop="priceCurrency" content="{{ shop.currency }}">
  246. <link itemprop="availability" href="http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}">
  247.  
  248. {% if section_onboarding %}
  249. <div class="product-single__add-to-cart default-product product-single__add-to-cart--full-width">
  250. <button type="submit" name="add" id="AddToCart--{{ section.id }}" class="btn btn--buy btn--add-to-cart" disabled="disabled">
  251. <span class="btn__text">
  252. <span class="fas fa-clock"></span>
  253. {{ 'products.product.sold_out' | t }}
  254. </span>
  255. </button>
  256. </div>
  257. {% else %}
  258. {% capture "form_classes" %}
  259. product-single__form{% if product.has_only_default_variant %} product-single__form--no-variants{% endif %}
  260. {%- endcapture %}
  261.  
  262. {% capture "form_id" %}AddToCartForm--{{ section.id }}{%- endcapture %}
  263.  
  264. {% include "dbtfy-color-swatches" %}{% form 'product', product, class:form_classes, id:form_id %}
  265. {% unless product.has_only_default_variant %}
  266. <div class="grid grid-uniform grid--small variant-wrapper">
  267. {% for option in product.options_with_values %}
  268. <div class="grid__item radio-wrapper js product-form__item {% if section.settings.product_selector == 'radio' %}product-form__item-radio {% endif %}">
  269. <label class="single-option-radio__label{% if option.name == 'Default' or option.name == 'Title' %} hidden-label{% endif %}"
  270. for="ProductSelect--{{ section.id }}-option-{{ forloop.index0 }}">
  271. {{ option.name | escape }}
  272. </label>
  273.  
  274. {% if section.settings.product_selector == 'radio' %}
  275. <fieldset class="single-option-radio"
  276. name="{{ option.name | handleize }}"
  277. id="ProductSelect--{{ section.id }}-option-{{ forloop.index0 }}">
  278. {% assign option_index = forloop.index %}
  279. {% for value in option.values %}
  280.  
  281. {% assign variant_label_state = true %}
  282. {% if product.options.size == 1 %}
  283. {% unless product.variants[forloop.index0].available %}
  284. {% assign variant_label_state = false %}
  285. {% endunless %}
  286. {% endif %}
  287.  
  288. <input type="radio"
  289. {% if option.selected_value == value %} checked="checked"{% endif %}
  290. {% unless variant_label_state %} disabled="disabled"{% endunless %}
  291. value="{{ value | escape }}"
  292. data-index="option{{ option_index }}"
  293. name="{{ option.name | handleize }}"
  294. class="single-option-selector__radio{% unless variant_label_state %} disabled{% endunless %}"
  295. id="ProductSelect--{{ section.id }}-option-{{ option.name | handleize }}-{{ value | escape }}">
  296. <label for="ProductSelect--{{ section.id }}-option-{{ option.name | handleize }}-{{ value | escape }}"class="btn btn--small {% unless variant_label_state %} disabled{% endunless %}">{{ value | escape }}</label>
  297. {% endfor %}
  298. </fieldset>
  299. {% else %}
  300. <select class="single-option-selector__radio single-option-selector-{{ section.id }} product-form__input" id="SingleOptionSelector-{{ forloop.index0 }}" data-index="option{{ forloop.index }}">
  301. {% for value in option.values %}
  302. <option value="{{ value | escape }}"{% if option.selected_value == value %} selected="selected"{% endif %}>{{ value | escape }}</option>
  303. {% endfor %}
  304. </select>
  305. {% endif %}
  306.  
  307. </div>
  308. {% endfor %}
  309. </div>
  310. {% endunless %}
  311.  
  312. <select name="id" id="ProductSelect" class="product-single__variants no-js product-form__item">
  313. {% for variant in product.variants %}
  314. {% if variant.available %}
  315. <option {% if variant == product.selected_or_first_available_variant %}
  316. selected="selected" {% endif %}
  317. data-sku="{{ variant.sku }}"
  318. value="{{ variant.id }}">
  319. {{ variant.title }} - {{ variant.price | money_with_currency }}
  320. </option>
  321. {% else %}
  322. <option disabled="disabled">
  323. {{ variant.title }} - {{ 'products.product.sold_out' | t }}
  324. </option>
  325. {% endif %}
  326. {% endfor %}
  327. </select>
  328.  
  329. {% if section.settings.quantity_enabled %}
  330. <div class="product-single__quantity product-form__item">
  331. <label for="Quantity" class="product-single__quantity-label">{{ 'products.product.quantity' | t }}</label>
  332. {% include 'quantity-selector', type:'product' %}
  333. </div>
  334. {% endif %}
  335.  
  336. <div class="product-single__add-to-cart product-single__add-to-cart--full-width">
  337. <button type="submit" name="add" id="AddToCart--{{ section.id }}"
  338. class="btn btn--buy btn--add-to-cart"
  339. {% unless current_variant.available %} disabled="disabled"{% endunless %}>
  340. <span class="btn__text">
  341. {% if section.settings.button_cart_icon %}
  342. <span class="fas fa-shopping-{{ settings.cart_icon }} button-cart-icon"></span>
  343. <span class="fas fa-clock button-soldout-icon"></span>
  344. {% endif %}
  345. <span class="btn__add-to-cart-text">
  346. {% if current_variant.available %}
  347. {{ 'products.product.add_to_cart' | t }}
  348. {% else %}
  349. {{ 'products.product.sold_out' | t }}
  350. {% endif %}
  351. </span>
  352. </span>
  353. </button>
  354. {% if section.settings.enable_payment_button %}
  355. {{ form | payment_button }}
  356. {% endif %}
  357. </div>
  358. {% endform %}
  359. {% endif %}
  360. </div>
  361.  
  362. {% include "dbtfy-sales-countdown" %}{% include "dbtfy-trust-badge", position: "product" %}{% unless product.description == blank or section.settings.show_description == false %}
  363. <div class="product-single__description rte" itemprop="description">
  364. {{ product.description }}
  365. </div>
  366. {% endunless %}
  367.  
  368. {% include "dbtfy-product-tabs" %} {% if section.settings.social_sharing_products %}
  369. {% include 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}
  370. {% endif %}
  371.  
  372. {% if section.settings.show_product_tags %}
  373. {% for tag in product.tags %}
  374. {% if forloop.first %}
  375. <div class="product-tags">
  376. <span>{{ 'blogs.article.tags' | t }}: </span>
  377. {% endif %}
  378. <a class="text-link" href="/collections/all/{{ tag | handleize }}">{{ tag }}</a>
  379. {% if forloop.last %}
  380. </div>
  381. {% endif %}
  382. {% endfor %}
  383. {% endif %}
  384.  
  385. {% if template != "product" %}
  386. <hr>
  387. <a {% unless section_onboarding %} href="{{ product.url }}?variant={{ current_variant.id }}"{% endunless %} class="text-link continue-link">
  388. {{ 'products.product.full_details' | t }} <span class="fas fa-arrow-right" aria-hidden="true"></span>
  389. </a>
  390. {% endif %}
  391. </div>
  392. {% include "dbtfy-sticky-addtocart" %} </div>
  393.  
  394. </div><!-- /.grid -->
  395. </div><!-- /.wrapper -->
  396. </div><!-- /.box -->
  397. </div><!-- /.product-single -->{% include "dbtfy-linked-options" %}
  398.  
  399.  
  400. <script>
  401. $(document).ready(function(){
  402.  
  403. });
  404. </script>
  405.  
  406.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement