commit c46bc454d3fb3d44dcb698b1e8a47904f38e97e7 Author: Axel Kee Date: Fri Sep 11 18:17:59 2026 +0800 first commit diff --git a/sections/product-template.liquid b/sections/product-template.liquid new file mode 100644 index 0000000..abf0a50 --- /dev/null +++ b/sections/product-template.liquid @@ -0,0 +1,845 @@ + +{%- assign first_3d_model = product.media | where: "media_type", "model" | first -%} + +
+ + + + + {% assign current_variant = product.selected_or_first_available_variant %} + {% assign featured_media = current_variant.featured_media | default: product.featured_media %} + + {% assign stacked = false %} + {% if section.settings.media_layout == "stacked" %}{% assign stacked = true %}{% endif %} + {%- assign first_media = true -%} + +
+
+
+
+ {%- assign enable_image_zoom = section.settings.enable_image_zoom -%} + {% assign height = 850 %} + {% assign width = 575 %} + {%- assign first_3d_model = product.media | where: "media_type", "model" | first -%} + {% comment %} + Display product images + {% endcomment %} + {%- for media in product.media -%} + {%- assign featured = false -%} + {%- if media == featured_media -%} + {%- assign featured = true -%} + {%- endif -%} + + {%- capture thumbnail_alt -%} + {%- if media.media_type == 'video' or media.media_type == 'external_video' -%} + {{ 'products.product.video_thumbnail_alt' | t: imageAlt: media.alt | escape }} + {%- elsif media.media_type == 'model' -%} + {{ 'products.product.model_thumbnail_alt' | t: imageAlt: media.alt | escape }} + {%- else -%} + {{ 'products.product.gallery_thumbnail_alt' | t: imageAlt: media.alt | escape }} + {%- endif -%} + {%- endcapture -%} + +
+
+ {%- include 'media' with media, enable_image_zoom: enable_image_zoom, stacked: stacked, featured: featured, width: width, height: height -%} + + {% comment %} + Display a "View in your space" button (multi) for the first visible media and each individual model. + Stacked layout only. + {% endcomment %} + {% if stacked %} + {%- assign xr_id = false -%} + {%- if first_media and first_3d_model -%} + {%- assign xr_id = first_3d_model.id -%} + {%- elsif media.media_type == 'model' -%} + {%- assign xr_id = media.id -%} + {%- endif -%} + + {%- if xr_id -%} + {%- include 'xr-button' with model_id: xr_id, multi: true -%} + {%- endif -%} + {%- assign first_media = false -%} + {% endif %} +
+
+ {%- endfor -%} +
+ + {% comment %} + Display a "View in your space" button (single). + Stacked/Thumbnails layout (mobile) + Thumbnail layout only (desktop) + {% endcomment %} + {%- if first_3d_model -%} + {%- include 'xr-button' with model_id: first_3d_model.id, multi: false -%} + {%- endif -%} + + {% unless stacked %} + + {% endunless %} +
+ + +
+
+
+
+
+ +
+
+ {% if section.settings.product_vendor_enable %} +

{{ product.vendor }}

+ {% endif %} + +

{{ product.title }}

+ +
+ {% comment %} + Optionally show the 'compare at' or original price of the product. + {% endcomment %} + {% unless product.tags contains "on_auction" or product.tags contains "wk_end_auction" or product.tags contains "upcoming_auction" %} + {% include 'product-price', variant: current_variant %} + + {%- if shop.taxes_included or shop.shipping_policy.body != blank -%} +
+ {%- if shop.taxes_included -%} + {{ 'products.general.include_taxes' | t }} + {%- endif -%} + {%- if shop.shipping_policy.body != blank -%} + {{ 'products.general.shipping_policy_html' | t: link: shop.shipping_policy.url }} + {%- endif -%} +
+ {%- endif -%} + {% endunless %} +
+
+ + + + + {% capture "form_classes" %} + product-single__form{% if product.has_only_default_variant %} product-single__form--no-variants{% endif %} + {%- endcapture %} + + {% capture "form_id" %}AddToCartForm--{{ section.id }}{%- endcapture %} + + {% form 'product', product, class:form_classes, id:form_id, data-product-form: '' %} + {% unless product.has_only_default_variant %} + {% for option in product.options_with_values %} +
+ + {% if section.settings.product_selector == 'radio' %} +
+ {% assign option_index = forloop.index %} + {% for value in option.values %} + {% assign variant_label_state = true %} + {% if product.options.size == 1 %} + {% unless product.variants[forloop.index0].available %} + {% assign variant_label_state = false %} + {% endunless %} + {% endif %} + + + {% endfor %} +
+ {% else %} + + {% endif %} +
+ {% endfor %} + {% endunless %} + + + + {% if section.settings.quantity_enabled %} +
+ + +
+ {% endif %} + {% unless product.tags contains "on_auction" or product.tags contains "wk_end_auction" or product.tags contains "upcoming_auction" %} +
+ + {% if section.settings.enable_payment_button %} + {{ form | payment_button }} + {% endif %} +
+ {% endunless %} + {% endform %} + +
+ +
+ {{ product.description }} +
+ + {% if section.settings.social_sharing_products %} + {% include 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product.featured_media %} + {% endif %} +
+
+
+
+{% unless product == empty %} + {% liquid + assign product_json = product | json + + for variant in product.variants + assign original_price = variant.price + assign discounted_price = variant.metafields['app--168074346497'].auto_discounted_price.value | default: variant.price + + if variant.metafields.app--168074346497.discount_percentage.value > 0.01 + assign deducted_percentage = 1.0 | minus: variant.metafields.app--168074346497.discount_percentage.value + assign discounted_price = variant.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil + endif + + if discounted_price != original_price + assign id_anchor = '"id":' | append: variant.id | append: ',' + assign split_parts = product_json | split: id_anchor + assign before_part = split_parts[0] + assign after_part = split_parts[1] + + assign search_price = '"price":' | append: original_price + assign replace_price = '"price":' | append: discounted_price + assign after_part = after_part | replace_first: search_price, replace_price + + if discounted_price < original_price + assign replace_compare = '"compare_at_price":' | append: original_price + assign search_compare_zero = '"compare_at_price":0' + assign search_compare_null = '"compare_at_price":null' + + if after_part contains search_compare_zero + assign after_part = after_part | replace_first: search_compare_zero, replace_compare + elsif after_part contains search_compare_null + assign after_part = after_part | replace_first: search_compare_null, replace_compare + endif + endif + + assign product_json = before_part | append: id_anchor | append: after_part + endif + endfor + %} + + + +{% endunless %} + + + +{% schema %} +{ + "name": { + "da": "Produktsider", + "de": "Produktseiten", + "en": "Product pages", + "es": "Páginas de productos", + "fi": "Tuotesivut", + "fr": "Pages de produits", + "hi": "उत्पाद पेज", + "it": "Pagine di prodotto", + "ja": "商品ページ", + "ko": "제품 페이지", + "nb": "Produktsider", + "nl": "Productpagina's", + "pt-BR": "Páginas de produtos", + "pt-PT": "Páginas de produtos", + "sv": "Produktsidor", + "th": "หน้าสินค้า", + "zh-CN": "产品页面", + "zh-TW": "產品頁面" + }, + "settings": [ + { + "type": "checkbox", + "id": "product_vendor_enable", + "label": { + "da": "Vis produktleverandør", + "de": "Produktanbieter anzeigen", + "en": "Show product vendor", + "es": "Mostrar proveedor del producto", + "fi": "Näytä tuotteen myyjä", + "fr": "Afficher le distributeur du produit", + "hi": "उत्पाद विक्रेता दिखाएं", + "it": "Indica fornitore prodotto", + "ja": "商品の販売元を表示する", + "ko": "제품 공급 업체 표시", + "nb": "Vis produktleverandør", + "nl": "Productleverancier weergeven", + "pt-BR": "Exiba o fornecedor do produto", + "pt-PT": "Mostrar o fornecedor do produto", + "sv": "Visa produktsäljare", + "th": "แสดงผู้ขายสินค้า", + "zh-CN": "显示产品厂商", + "zh-TW": "顯示產品廠商" + } + }, + { + "type": "checkbox", + "id": "social_sharing_products", + "label": { + "da": "Aktivér produktdeling", + "de": "Teilen von Produkten aktivieren", + "en": "Enable product sharing", + "es": "Habilitar compartir productos", + "fi": "Ota tuotejako käyttöön", + "fr": "Activer le partage de produits", + "hi": "उत्पाद साझाकरण सक्षम करें", + "it": "Permetti condivisione del prodotto", + "ja": "商品の共有を有効にする", + "ko": "제품 공유 활성화", + "nb": "Aktiver produktdeling", + "nl": "Schakel het delen van producten in", + "pt-BR": "Habilite o compartilhamento de produtos", + "pt-PT": "Ativar a partilha de produtos", + "sv": "Aktivera produktdelning", + "th": "เปิดใช้การแชร์สินค้า", + "zh-CN": "启用产品分享", + "zh-TW": "啟用產品分享" + }, + "default": true + }, + { + "type": "header", + "content": { + "da": "Formular for produktmuligheder", + "de": "Produktoptionsformular", + "en": "Product options form", + "es": "Formulario de opciones de producto", + "fi": "Tuotevaihtoehtolomake", + "fr": "Formulaire d'options de produit", + "hi": "उत्पाद के विकल्प फ़ॉर्म", + "it": "Modulo delle opzioni di prodotto", + "ja": "商品オプションのフォーム", + "ko": "제품 옵션 양식", + "nb": "Skjema for produktalternativer", + "nl": "Formulier productopties", + "pt-BR": "Formulário de opções de produtos", + "pt-PT": "Formulário de opções de produtos", + "sv": "Produktalternativsformulär", + "th": "แบบฟอร์มตัวเลือกสินค้า", + "zh-CN": "产品选项表单", + "zh-TW": "產品選項表單" + } + }, + { + "type": "checkbox", + "id": "quantity_enabled", + "label": { + "da": "Vis antalsvælger", + "de": "Mengenauswahl anzeigen", + "en": "Show quantity picker", + "es": "Mostrar selector de cantidad", + "fi": "Näytä määrän valintatyökalu", + "fr": "Afficher le sélecteur de quantité", + "hi": "मात्रा पिकर दिखाएं", + "it": "Mostra selettore di quantità", + "ja": "数量ピッカーを表示する", + "ko": "수량 선택기 표시", + "nb": "Vis mengdevelger", + "nl": "Hoeveelheidskiezer weergeven", + "pt-BR": "Exibir seletor de quantidade", + "pt-PT": "Mostrar seletor de quantidade", + "sv": "Visa kvantitetsväljaren", + "th": "แสดงเครื่องมือเลือกจำนวน", + "zh-CN": "显示数量选择器", + "zh-TW": "顯示數量選擇器" + } + }, + { + "type": "select", + "id": "product_selector", + "label": { + "da": "Vælgertype", + "de": "Auswahlart", + "en": "Picker type", + "es": "Tipo de selector", + "fi": "Valitsintyyppi", + "fr": "Type de sélecteur", + "hi": "पिकर के प्रकार", + "it": "Tipo di selettore", + "ja": "ピッカーの種類", + "ko": "선택기 유형", + "nb": "Velgertype", + "nl": "Soort kiezer", + "pt-BR": "Tipo de seletor", + "pt-PT": "Tipo de seletor", + "sv": "Väljartyp", + "th": "ประเภทของเครื่องมือเลือก", + "zh-CN": "选择器类型", + "zh-TW": "選擇器類型" + }, + "options": [ + { + "value": "radio", + "label": { + "da": "Knap", + "de": "Schaltfläche", + "en": "Button", + "es": "Botón", + "fi": "Painike", + "fr": "Bouton", + "hi": "बटन", + "it": "Pulsante", + "ja": "ボタン", + "ko": "버튼", + "nb": "Knapp", + "nl": "Knop", + "pt-BR": "Botão", + "pt-PT": "Botão", + "sv": "Knapp", + "th": "ปุ่ม", + "zh-CN": "按钮", + "zh-TW": "按鈕" + } + }, + { + "value": "select", + "label": { + "da": "Rullemenu", + "de": "Dropdown", + "en": "Dropdown", + "es": "Desplegable", + "fi": "Pudotusvalikko", + "fr": "Menu déroulant", + "hi": "ड्रॉप डाउन", + "it": "Menu a tendina", + "ja": "ドロップダウン", + "ko": "드롭다운", + "nb": "Rullegardin", + "nl": "Vervolgkeuzemenu", + "pt-BR": "Menu suspenso", + "pt-PT": "Menu pendente", + "sv": "Rullgardinsmeny", + "th": "ดรอปดาวน์", + "zh-CN": "下拉菜单", + "zh-TW": "下拉式選單" + } + } + ] + }, + { + "type": "header", + "content": { + "da": "Knappen Læg i indkøbskurven", + "de": "Schaltfläche In den Warenkorb", + "en": "Add to cart button", + "es": "Añadir al carrito", + "fi": "Lisää ostoskoriin -painike", + "fr": "Bouton d'ajout au panier", + "hi": "कार्ट बटन में जोड़ें", + "it": "Pulsante \"Aggiungi al carrello\"", + "ja": "カートボタンに追加する", + "ko": "카트 버튼에 추가", + "nb": "Legg i handlekurv-knapp", + "nl": "Knop aan winkelwagen toevoegen", + "pt-BR": "Botão Adicionar ao carrinho", + "pt-PT": "Botão Adicionar ao carrinho", + "sv": "Lägg i varukorgen-knappen", + "th": "ปุ่มเพิ่มลงในตะกร้าสินค้า", + "zh-CN": "“添加到购物车”按钮", + "zh-TW": "加入購物車按鈕" + } + }, + { + "type": "checkbox", + "id": "enable_payment_button", + "label": { + "da": "Vis dynamisk betalingsknap", + "de": "Dynamischen Checkout-Button anzeigen", + "en": "Show dynamic checkout button", + "es": "Mostrar botón de pago dinámico", + "fi": "Näytä dynaaminen kassapainike", + "fr": "Afficher le bouton de paiement dynamique", + "hi": "डायनेमिक चेकआउट बटन दिखाएं", + "it": "Mostra pulsante di check-out dinamico", + "ja": "動的チェックアウトボタンを表示する", + "ko": "동적 결제 버튼 표시", + "nb": "Vis dynamisk knapp for å gå til kassen", + "nl": "Dynamische betaalknop weergeven", + "pt-BR": "Exibir botão de checkout dinâmico", + "pt-PT": "Mostrar o botão dinâmico de finalização da compra", + "sv": "Visa dynamiska utcheckningsknappar", + "th": "แสดงปุ่มชำระเงินแบบไดนามิก", + "zh-CN": "显示动态结账按钮", + "zh-TW": "顯示動態結帳按鈕" + }, + "info": { + "da": "Den enkelte kunde vil se sin foretrukne betalingsmetode blandt dem, der er tilgængelige i din butik, f.eks. PayPal eller Apple Pay. [Få mere at vide](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "de": "Jeder Kunde sieht seine bevorzugte Zahlungsmethode aus den in Ihrem Shop verfügbaren Zahlungsmethoden wie PayPal oder Apple Pay. [Mehr Informationen](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "en": "Each customer will see their preferred payment method from those available on your store, such as PayPal or Apple Pay. [Learn more](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "es": "Cada cliente verá su forma de pago preferida entre las disponibles en tu tienda, como PayPal o Apple Pay. [Más información](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "fi": "Kukin asiakas näkee ensisijaisen valintansa kauppasi tarjoamista maksutavoista, esim. PayPal tai Apple Pay. [Lisätietoja](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "fr": "Chaque client verra son moyen de paiement préféré parmi ceux qui sont proposés sur votre boutique, tels que PayPal ou Apple Pay. [En savoir plus](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "hi": "प्रत्येक ग्राहक आपके स्टोर पर उपलब्ध अपनी पसंदीदा भुगतान की विधि देखेंगे जैसे PayPal या Apple Pay. [अधिक जानें](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "it": "Ogni cliente vedrà il suo metodo di pagamento preferito tra quelli disponibili nel tuo negozio, come PayPal o Apple Pay. [Maggiori informazioni](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "ja": "PayPalやApple Payなど、ストアで利用可能な希望の決済方法がお客様に表示されます。[詳しくはこちら](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "ko": "각 고객은 PayPal 또는 Apple Pay와 같이 스토어에서 사용 가능한 지불 방법을 확인할 수 있습니다. [자세히 알아보기](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "nb": "Hver enkelt kunde vil se sin foretrukne betalingsmåte blant de som er tilgjengelig i butikken din, som PayPal eller Apple Pay. [Finn ut mer](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "nl": "Elke klant ziet zijn of haar beschikbare voorkeursmethode om af te rekenen, zoals PayPal of Apple Pay. [Meer informatie](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "pt-BR": "Cada cliente verá a forma de pagamento preferencial dele dentre as disponíveis na loja, como PayPal ou Apple Pay. [Saiba mais](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "pt-PT": "Cada cliente irá ver o seu método de pagamento preferido entre os disponíveis na loja, como o PayPal ou Apple Pay. [Saiba mais](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "sv": "Varje kund kommer att se den föredragna betalningsmetoden från de som finns tillgängliga i din butik, till exempel PayPal eller Apple Pay. [Läs mer](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "th": "ลูกค้าแต่ละรายจะเห็นวิธีการชำระเงินที่ต้องการจากวิธีที่ใช้ได้ในร้านค้าของคุณ เช่น PayPal หรือ Apple Pay [ดูข้อมูลเพิ่มเติม](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "zh-CN": "每位客户都可在您商店提供的付款方式中看到他们的首选付款方式,例如 PayPal 或 Apple Pay。[了解详细信息](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)", + "zh-TW": "每位顧客都可以在您商店內開放使用的付款方式中看見他們偏好使用的方式,如 PayPal、Apple Pay 等。[深入瞭解](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)" + }, + "default": true + }, + { + "type": "select", + "id": "add_to_cart_button_size", + "label": { + "da": "Knapstørrelse", + "de": "Schaltflächengröße", + "en": "Button size", + "es": "Tamaño del botón", + "fi": "Painikkeen koko", + "fr": "Taille du bouton", + "hi": "बटन का आकार", + "it": "Dimensione pulsante", + "ja": "ボタンのサイズ", + "ko": "버튼 사이즈", + "nb": "Knappestørrelse", + "nl": "Afmeting knop", + "pt-BR": "Tamanho do botão", + "pt-PT": "Tamanho do botão", + "sv": "Knappstorlek", + "th": "ขนาดปุ่ม", + "zh-CN": "按钮大小", + "zh-TW": "按鈕尺寸" + }, + "default": "small", + "options": [ + { + "value": "small", + "label": { + "da": "Lille", + "de": "Klein", + "en": "Small", + "es": "Pequeña", + "fi": "Pieni", + "fr": "Petit", + "hi": "छोटा", + "it": "Piccolo", + "ja": "小", + "ko": "스몰", + "nb": "Liten", + "nl": "Klein", + "pt-BR": "Pequeno", + "pt-PT": "Pequeno", + "sv": "Liten", + "th": "เล็ก", + "zh-CN": "小", + "zh-TW": "小型" + } + }, + { + "value": "large", + "label": { + "da": "Stor", + "de": "Groß", + "en": "Large", + "es": "grande", + "fi": "Suuri", + "fr": "Grand", + "hi": "बड़ा", + "it": "Grande", + "ja": "大", + "ko": "라지", + "nb": "Stor", + "nl": "Groot", + "pt-BR": "Grande", + "pt-PT": "Grande", + "sv": "Stor", + "th": "ใหญ่", + "zh-CN": "大", + "zh-TW": "大型" + } + } + ] + }, + { + "type": "header", + "content": { + "da": "Medie", + "de": "Medien", + "en": "Media", + "es": "Elementos multimedia", + "fi": "Media", + "fr": "Médias", + "hi": "मीडिया", + "it": "Media", + "ja": "メディア", + "ko": "미디어", + "nb": "Medier", + "nl": "Media", + "pt-BR": "Mídia", + "pt-PT": "Multimédia", + "sv": "Media", + "th": "สื่อ", + "zh-CN": "媒体", + "zh-TW": "媒體" + }, + "info": { + "da": "Få mere at vide om [media types](https://help.shopify.com/manual/products/product-media)", + "de": "Mehr Informationen über [Medientypen ](https://help.shopify.com/manual/products/product-media)", + "en": "Learn more about [media types](https://help.shopify.com/manual/products/product-media)", + "es": "Más información sobre [tipos de archivos multimedia](https://help.shopify.com/manual/products/product-media)", + "fi": "Lue lisää [mediatyypeistä](https://help.shopify.com/manual/products/product-media)", + "fr": "En savoir plus sur les [types de supports multimédia](https://help.shopify.com/manual/products/product-media)", + "hi": "[मीडिया प्रकार](https://help.shopify.com/manual/products/product-media) के बारे में और जानें", + "it": "Scopri di più sulle [tipologie di file multimediali](https://help.shopify.com/manual/products/product-media)", + "ja": "[メディアのタイプ](https://help.shopify.com/manual/products/product-media) について詳しくはこちら", + "ko": "[미디어 유형](https://help.shopify.com/manual/products/product-media)에 대해 자세히 알아보기", + "nb": "Lær mer om [medietyper](https://help.shopify.com/manual/products/product-media)", + "nl": "Meer informatie over [mediatypen](https://help.shopify.com/manual/products/product-media)", + "pt-BR": "Saiba mais sobre [tipos de mídia](https://help.shopify.com/manual/products/product-media)", + "pt-PT": "Saiba mais sobre [media types](https://help.shopify.com/manual/products/product-media)", + "sv": "Läs mer om [mediatyper](https://help.shopify.com/manual/products/product-media)", + "th": "ดูข้อมูลเพิ่มเติมเกี่ยวกับ [ประเภทของสื่อ](https://help.shopify.com/manual/products/product-media)", + "zh-CN": "详细了解[媒体类型](https://help.shopify.com/manual/products/product-media)", + "zh-TW": "深入瞭解 [媒體類型](https://help.shopify.com/manual/products/product-media)" + } + }, + { + "type": "select", + "id": "media_layout", + "label": { + "da": "Gallerilayout", + "de": "Galerie-Layout", + "en": "Gallery layout", + "es": "Diseño de la galería", + "fi": "Gallerian pohja", + "fr": "Mise en page de la galerie", + "hi": "गैलरी लेआउट", + "it": "Layout galleria", + "ja": "ギャラリーのレイアウト", + "ko": "갤러리 레이아웃", + "nb": "Gallerioppsett", + "nl": "Galerij-opmaak", + "pt-BR": "Layout da galeria", + "pt-PT": "Esquema da galeria", + "sv": "Galleri-layout", + "th": "เลย์เอาต์แกลเลอรี", + "zh-CN": "图库布局", + "zh-TW": "圖庫版面配置" + }, + "default": "stacked", + "options": [ + { + "value": "stacked", + "label": { + "da": "Stablet", + "de": "Gestapelt", + "en": "Stacked", + "es": "Stacked", + "fi": "Pinottu", + "fr": "Empiler", + "hi": "स्टैक्ड", + "it": "Elenco", + "ja": "スタックされました", + "ko": "누적", + "nb": "Stablet", + "nl": "Gestapeld", + "pt-BR": "Empilhado", + "pt-PT": "Empilhado", + "sv": "Staplade", + "th": "ซ้อน", + "zh-CN": "已堆叠", + "zh-TW": "已堆疊" + } + }, + { + "value": "thumbnails", + "label": { + "da": "Miniaturer", + "de": "Vorschaubilder", + "en": "Thumbnails", + "es": "Miniaturas", + "fi": "Pikkukuvat", + "fr": "Vignettes", + "hi": "थंबनेल", + "it": "Miniature", + "ja": "サムネイル", + "ko": "썸네일", + "nb": "Miniatyrbilder", + "nl": "Miniatuurafbeeldingen", + "pt-BR": "Miniaturas", + "pt-PT": "Miniaturas", + "sv": "Förhandsbilder", + "th": "ขนาดย่อ", + "zh-CN": "缩略图", + "zh-TW": "縮圖" + } + } + ] + }, + { + "type": "checkbox", + "id": "enable_image_zoom", + "label": { + "da": "Aktivér billedzoom", + "de": "Foto-Zoom zulassen", + "en": "Enable image zoom", + "es": "Habilitar zoom de imagen", + "fi": "Ota kuvan zoomaus käyttöön", + "fr": "Activer le zoom d'image", + "hi": "इमेज ज़ूम सक्षम करें", + "it": "Abilita lo zoom dell'immagine", + "ja": "画像ズームを有効にする", + "ko": "이미지 확대 사용", + "nb": "Aktiver bildezoom", + "nl": "Inzoomen op afbeelding inschakelen", + "pt-BR": "Habilitar o zoom da imagem", + "pt-PT": "Ativar o zoom da imagem", + "sv": "Aktivera bildzoom", + "th": "เปิดใช้การซูมภาพ", + "zh-CN": "启用图片缩放", + "zh-TW": "啟用圖片縮放" + } + }, + { + "type": "checkbox", + "id": "enable_video_looping", + "label": { + "da": "Aktivér looping af videoer", + "de": "Videschleife aktivieren", + "en": "Enable video looping", + "es": "Habilitar la reproducción de video en bucle", + "fi": "Ota käyttöön videosilmukka", + "fr": "Activer le bouclage de la vidéo", + "hi": "वीडियो लूपिंग सक्षम करें", + "it": "Abilita la riproduzione in loop dei video", + "ja": "ビデオのループを有効にする", + "ko": "동영상 루프 활성화", + "nb": "Aktiver løkkeavspilling av video", + "nl": "Video-looping inschakelen", + "pt-BR": "Habilitar loop de vídeo", + "pt-PT": "Ativar ciclo de vídeo", + "sv": "Aktivera video-loopning", + "th": "เปิดใช้งานการวนซ้ำวิดีโอ", + "zh-CN": "启用视频循环", + "zh-TW": "啟用影片循環功能" + }, + "default": false + } + ] +} +{% endschema %} diff --git a/snippets/product-grid-item.liquid b/snippets/product-grid-item.liquid new file mode 100644 index 0000000..1f3ab5e --- /dev/null +++ b/snippets/product-grid-item.liquid @@ -0,0 +1,166 @@ + +{% comment %} + + This snippet is used to showcase each product during the loop, + 'for product in collection.products' in collection.liquid. + + A liquid variable (grid_item_width) is set just before the this + snippet is included to change the size of the container. + Once the variable is set on a page, all future instances of this + snippet will use that width. Overwrite the variable to adjust this. + + Example + - assign grid_item_width = 'large--one-quarter medium--one-half' + +{% endcomment %} +{% unless product.tags contains "wk_auction" %} +{% unless grid_item_width %} + {% assign grid_item_width = 'large--one-third medium--one-half' %} +{% endunless %} + +{% unless width %} + {%- assign width = 310 -%} +{% endunless %} +{% unless height %} + {%- assign height = 415 -%} +{% endunless %} + +{% liquid + assign product_price = product.metafields.app--168074346497.min_auto_discounted_price.value | default: product.price + assign product_compare_at_price = product.compare_at_price + + if product.metafields.app--168074346497.discount_percentage.value > 0.01 + assign deducted_percentage = 1.0 | minus: product.metafields.app--168074346497.discount_percentage.value + + assign product_price = product.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil + + assign product_compare_at_price = product.price + + if product.compare_at_price > product_compare_at_price + assign product_compare_at_price = product.compare_at_price + endif + endif + + if shop.metafields.app--168074346497.discount_percentage.value > 0.005 + assign discount_percentage = shop.metafields.app--168074346497.discount_percentage.value | times: 1.0 + assign deducted_percentage = 1.0 | minus: discount_percentage + + assign product_price = product.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil + + assign product_compare_at_price = product.price + + if product.compare_at_price > product_compare_at_price + assign product_compare_at_price = product.compare_at_price + endif + endif + + if product_price < product.price and product_compare_at_price == blank + assign product_compare_at_price = product.price + endif +%} +{% assign on_sale = false %} +{% if product_compare_at_price > product_price %} + {% assign on_sale = true %} +{% endif %} + +{% assign sold_out = true %} +{% if product.available %} + {% assign sold_out = false %} +{% endif %} + +{%- assign variant = product.selected_or_first_available_variant -%} + +{% capture img_id_class %}ProductImage-{{ product.featured_media.id }}{% endcapture %} +{% capture img_wrapper_id %}ProductImageWrapper-{{ product.featured_media.id }}{% endcapture %} +{%- assign featured_image = product.featured_media.preview_image %} +{%- assign img_url = featured_image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%} + +
+
+
+ + {% if featured_image.src == blank %} + {{ featured_image.alt | escape }} + {% else %} + {% include 'image-style' with image: featured_image, small_style: true, width: width, height: height, wrapper_id: img_wrapper_id, img_id_class: img_id_class %} +
+
+ {{ featured_image.alt | escape }} +
+
+ + {% endif %} +
+ {% if sold_out %} +
+

{{ 'products.product.sold_out_html' | t }}

+
+ {% elsif on_sale %} +
+ {% capture saved_amount %}{{ product_compare_at_price | minus: product_price | money_without_trailing_zeros }}{% endcapture %} +

{{ 'products.general.save_html' | t: saved_amount: saved_amount }}

+
+ {% endif %} +
+ + + {{ product.title }} + {% unless product.tags contains "on_auction" or product.tags contains "wk_end_auction" or product.tags contains "upcoming_auction" %} + + — + + {% if on_sale %} + {{ 'products.general.sale_price' | t }} + {% else %} + {{ 'products.general.regular_price' | t }} + {% endif %} + {% if product_compare_at_price > product_price %} + {{ product_compare_at_price | money_without_trailing_zeros }} + {% endif %} + {% if product.price_varies %} + {{ product_price | money_without_trailing_zeros }} + + + + + + {% else %} + {{ product_price | money_without_trailing_zeros }} + {% endif %} + + + {%- if product.price_varies == false and variant.unit_price_measurement -%} + {%- capture unit_price_separator -%} +  {{ 'general.accessibility.unit_price_separator' | t }}  + {%- endcapture -%} + + {%- capture unit_price_base_unit -%} + + {%- if variant.unit_price_measurement.reference_value != 1 -%} + {{- variant.unit_price_measurement.reference_value -}} + {%- endif -%} + {{ variant.unit_price_measurement.reference_unit }} + + {%- endcapture -%} + + {{ 'products.general.unit_price' | t }} + {{ variant.unit_price | money }}{{- unit_price_separator -}}{{- unit_price_base_unit -}} + + {%- endif -%} + + {% endunless %} +
+ {% if section.settings.product_vendor_enable %} +

{{ product.vendor }}

+ {% endif %} +
+
+
+{% endunless %} \ No newline at end of file diff --git a/snippets/product-price.liquid b/snippets/product-price.liquid new file mode 100644 index 0000000..524e19d --- /dev/null +++ b/snippets/product-price.liquid @@ -0,0 +1,82 @@ +{% liquid + assign variant_price = variant.metafields.app--168074346497.auto_discounted_price.value | default: variant.price + assign variant_compare_at_price = variant.compare_at_price + + if variant.metafields.app--168074346497.discount_type.value != nil and variant.metafields.app--168074346497.discount_type.value != "fixed" and product.metafields.app--168074346497.discount_percentage.value > 0.01 + assign deducted_percentage = 1.0 | minus: product.metafields.app--168074346497.discount_percentage.value + + if variant.metafields.app--168074346497.discount_percentage.value > 0.01 + assign deducted_percentage = 1.0 | minus: variant.metafields.app--168074346497.discount_percentage.value + endif + + assign variant_price = variant.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil + + assign variant_compare_at_price = variant.price + + if variant.compare_at_price > compare_at_price + assign variant_compare_at_price = variant.compare_at_price + endif + endif + + if shop.metafields.app--168074346497.discount_percentage.value > 0.005 + assign discount_percentage = shop.metafields.app--168074346497.discount_percentage.value | times: 1.0 + assign deducted_percentage = 1.0 | minus: discount_percentage + + assign variant_price = variant.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil + + assign variant_compare_at_price = variant.price + + if variant.compare_at_price > compare_at_price + assign variant_compare_at_price = variant.compare_at_price + endif + endif + + if variant_price < variant.price and variant_compare_at_price == blank + assign variant_compare_at_price = variant.price + endif +%} +
+ {%- if variant_compare_at_price > variant_price -%} + {{ 'products.general.regular_price' | t }} + + + {{ variant_compare_at_price | money }} + + + {{ 'products.general.sale_price' | t }} + {%- else -%} + {{ 'products.general.regular_price' | t }} + + + {%- endif -%} + + + {{ variant_price | money }} + + +
+ {%- capture unit_price_separator -%} +  {{ 'general.accessibility.unit_price_separator' | t }}  + {%- endcapture -%} + + {%- capture unit_price_base_unit -%} + + {%- if variant.unit_price_measurement -%} + {%- if variant.unit_price_measurement.reference_value != 1 -%} + {{- variant.unit_price_measurement.reference_value -}} + {%- endif -%} + {{ variant.unit_price_measurement.reference_unit }} + {%- endif -%} + + {%- endcapture -%} + + {{ 'products.general.unit_price' | t }} + {{ variant.unit_price | money }}{{- unit_price_separator -}}{{- unit_price_base_unit -}} + +
+