commit 11d7eb91db8dff05db1f958db99fb2c5a03b2966 Author: Axel Kee Date: Tue Apr 21 21:49:01 2026 +0800 first commit diff --git a/sections/predictive-search.liquid b/sections/predictive-search.liquid new file mode 100644 index 0000000..6fb8d02 --- /dev/null +++ b/sections/predictive-search.liquid @@ -0,0 +1,323 @@ +
+ + {%- if predictive_search.performed -%} + + {%- assign clean_terms = predictive_search.terms | split: ' AND ' | last | remove_first: '*' -%} + {% assign searchTerms = predictive_search.terms | split: "AND" | first | remove: "*" %} + +{%- assign total_count = 0 -%} + + {%- if predictive_search.resources.queries.size > 0 -%} + {%- assign total_count = total_count | plus: predictive_search.resources.queries.size -%} + + {%- endif -%} + + +{%- if predictive_search.resources.products.size > 0 -%} +{%- assign total_count = total_count | plus: predictive_search.resources.queries.size -%} + + +
+

{{ 'general.search.search_products' | t }}

+
+ +{%- endif -%} + + + {%- if predictive_search.resources.collections.size > 0 -%} + {%- assign total_count = total_count | plus: predictive_search.resources.collections.size -%} + + +
+

{{ 'general.search.search_collections' | t }}

+
+ + + + {%- endif -%} + +{%- if predictive_search.resources.pages.size > 0 -%} + {%- assign total_count = total_count | plus: predictive_search.resources.pages.size -%} + + +
+

{{ 'general.search.search_pages' | t }}

+
+ + + {% endif %} + +{%- if predictive_search.resources.articles.size > 0 -%} + {%- assign total_count = total_count | plus: predictive_search.resources.articles.size -%} + +
+

{{ 'general.search.search_articles' | t }}

+
+ + +{%- endif -%} + + +{%- if total_count > 3 -%} + +{%- endif -%} + + + {%- elsif search.performed -%} + + +{%- assign clean_terms = search.terms | split: ' AND ' | last | remove_first: '*' -%} +{% assign searchTerms = search.terms | split: "AND" | first | remove: "*" %} + + +{%- if search.results_count > 0 -%} + +{% assign foundProduct = false %} +{% assign foundPage = false %} +{% assign foundArticle = false %} + +{% for item in search.results %} +{% if item.object_type == 'product' %} +{% assign foundProduct = true %} +{% elsif item.object_type == 'page' %} +{% assign foundPage = true %} +{% elsif item.object_type == 'article' %} +{% assign foundArticle = true %} +{% endif %} +{% endfor %} + + {%- if foundProduct -%} +
+

{{ 'general.search.search_products' | t }}

+
+ + {%- else -%} + + {%- if foundPage -%} +
+

{{ 'general.search.search_pages' | t }}

+
+ + {% elsif foundArticle %} +
+

{{ 'general.search.search_articles' | t }}

+
+ + {% endif %} + + {%- endif -%} + + {% if search.types contains 'product' %} + {%- if search.results_count > 3 -%} + + {%- endif -%} + {% endif %} + +{%- endif -%} +{%- endif -%} + +
+ +{% schema %} + { + "name": "Search ajax" + } +{% endschema %} \ No newline at end of file diff --git a/sections/product-template.liquid b/sections/product-template.liquid new file mode 100644 index 0000000..b7dc452 --- /dev/null +++ b/sections/product-template.liquid @@ -0,0 +1,1951 @@ + + + {% assign show_form_popup = false %} +{%- assign enable_image_zoom = section.settings.enable_image_zoom -%} + + + +{%- assign initial_media_index = 0 -%} +{%- assign current_variant = product.selected_or_first_available_variant -%} +{%- assign price = current_variant.price -%} +{%- assign available = current_variant.available -%} + +{%- for media in product.media -%} +{%- if product.selected_variant and media.id == product.selected_variant.featured_media.id -%} +{%- assign initial_media_index = forloop.index0 -%} +{% endif %} +{% endfor %} + + +{% assign show_preOrderButton = false %} +{% if current_variant.inventory_policy == 'continue' and current_variant.inventory_management == 'shopify' and settings.show_preOrder_btn and current_variant.inventory_quantity <= 0 %} +{% assign show_preOrderButton = true %} +{% endif %} + +{% assign hide_price0_box_and_button = false %} +{% if settings.hide_price0_box_and_button and product.price_max == 0 %} +{% assign hide_price0_box_and_button = true %} +{% endif %} + + +{% assign product_description_in_static_tab = false %} +{% assign show_static_tabs = false %} +{% for block in section.blocks %} +{% if block.type contains 'static_tab' %} +{% assign show_static_tabs = true %} + +{% if block.settings.product_tab_use_product_description %} +{% assign product_description_in_static_tab = true %} +{% break %} +{% endif %} +{% endif %} +{% endfor %} + + +{%- capture flickity_options -%} +{ +"prevNextButtons": true, +"pageDots": false, +"adaptiveHeight": true, +"cellAlign": "left", +"contain": true, + "pauseAutoPlayOnHover": true, +"dragThreshold": 8, +"initialIndex": {{ initial_media_index }}, +"arrowShape": {"x0": 20, "x1": 60, "y1": 40, "x2": 60, "y2": 35, "x3": 25} +} +{%- endcapture -%} + + +{%- capture thumb_flickity_options -%} +{ +"prevNextButtons": false, +"pageDots": false, + "pauseAutoPlayOnHover": true, +"contain": true, +"cellAlign": "left", +"dragThreshold": 8, +"initialIndex": {{ initial_media_index }}, +"arrowShape": {"x0": 20, "x1": 60, "y1": 40, "x2": 60, "y2": 35, "x3": 25} +} +{%- endcapture -%} + +{% assign cart_icon_style = settings.header_cart_icon_style %} + + +{% assign show_breadcrumbs = section.settings.show_breadcrumbs %} + +{% if template.suffix == 'quick-view' %} +{% assign show_breadcrumbs = false %} +{% endif %} + + +{% assign show_inventory_quantity = false %} +{% assign low_inventory_threshold = 0 %} +{% assign show_product_desc_full_width = false %} + + {% assign enable_alts = false %} + {% for media in product.media %} + {%- assign media_alt = media.alt -%} + + {%- if media.alt contains '#' -%} + {%- assign is_media_group = true -%} + {%- assign alt_parts = media.alt | split: '#' -%} + + {%- assign media_group_parts = alt_parts.last | split: '_' -%} + + {%- assign downcase_group_option = media_group_parts.first | strip | downcase -%} + + {%- assign downcase_group_value = media_group_parts.last | strip | downcase -%} + + + {%- for option in product.options -%} + {%- assign downcase_option = option | downcase -%} + + {%- if downcase_option == downcase_group_option -%} + {% assign enable_alts = true %} + {% break %} + {% endif %} + {% endfor %} + {%- endif -%} + {% endfor %} + +
+ + {% if show_breadcrumbs %} + {% render 'breadcrumbs' product:product %} + {% endif %} + + + + {% comment %} + Get first variant, or deep linked one + {% endcomment %} + {%- assign product_thumb_size = '110x110' -%} + {%- assign product_image_zoom_size = '1024x1024' -%} + {%- assign product_image_scale = '2' -%} + + + {% assign thumbnails_type = section.settings.thumbnails_type %} + {% assign thumbnails_size = section.settings.thumbnails_size %} + + {% assign show_thumbnails = true %} + + {% if thumbnails_type == 'none' %} + {% assign show_thumbnails = false %} + {% endif %} + + {% assign enable_thumbnail_slides = false %} + {% if thumbnails_type == 'carousel' %} + {% assign enable_thumbnail_slides = true %} + {% endif %} + + + {% case section.settings.media_size %} + {% when 'small' %} + {%- assign product_media_width = 'medium-up--one-third' -%} + {%- assign product_description_width = 'medium-up--two-thirds' -%} + {%- assign height = 345 -%} + {% when 'medium' %} + {%- assign product_media_width = 'medium-up--one-half' -%} + {%- assign product_description_width = 'medium-up--one-half' -%} + {%- assign height = 530 -%} + {% when 'large' %} + {%- assign product_media_width = 'medium-up--two-thirds' -%} + {%- assign product_description_width = 'medium-up--one-third' -%} + {%- assign height = 720 -%} + {% when 'full' %} + {%- assign product_media_width = '' -%} + {%- assign product_description_width = '' -%} + {%- assign height = 1090 -%} + {% endcase %} + + + + + {% assign enabled_mobile_sticky_btns = section.settings.enabled_mobile_sticky_btns %} + + {% if template.suffix == 'quick-view' %} + {% assign enabled_mobile_sticky_btns = false %} + {% endif %} + + +
+ +
+
+ + {% capture "form_classes" -%} + product-form product-form-{{ section.id }} + {%- if section.settings.enable_payment_button and product.has_only_default_variant%} product-form--payment-button-no-variants{% endif %} + {%- if current_variant.available == false %} product-form--variant-sold-out {%- endif -%} + {%- endcapture %} + {% form 'product', product, class:form_classes, data-product-form: '' %} + + {% assign show_default_variant_input = true %} + + {% for block in section.blocks %} + {% case block.type %} + + + {% when 'complementary' %} + + {% assign enable_quick_add = block.settings.enable_quick_add %} + +
+ + {% if block.settings.block_heading != blank %} +
{{ block.settings.block_heading }}
+ {% endif %} + + + {% assign products_per_page = block.settings.products_per_page | times: 1 %} + {% assign recommendations_products_size = recommendations.products | size %} + + + {%- capture flickity_options -%} +{ + "prevNextButtons": false, + "wrapAround": true, + "dragThreshold": 15, + "cellAlign": "left", + "autoPlay": false, + "pageDots": false +} +{%- endcapture -%} + + + +
+ {%- if recommendations.performed and recommendations.products_count > 0 -%} + {%- assign max_height = 250 -%} + +
+
+ {%- for prod in recommendations.products limit: block.settings.product_list_limit offset: continue -%} + {% assign modulo_index = forloop.index | modulo:products_per_page %} + + {% render 'product-card-item', enable_quick_add: enable_quick_add, block:block,isComplementary_product: true,list: true, max_height: max_height, product: prod, show_vendor: false,products_per_row: 1 %} + + {% if modulo_index == 0 and recommendations_products_size != forloop.index %} +
+
+ {% endif %} + {% endfor %} +
+
+ {% endif %} +
+ +
+ + + + + + {% when "@app" %} + {% render block %} + + {% when 'product_price' %} +
+ {% render 'product-price', variant: current_variant, product: product %} +
+ {%- if cart.taxes_included or shop.shipping_policy.body != blank -%} +
+ {%- if cart.taxes_included -%} + {{ 'products.product.include_taxes' | t }} + {%- endif -%} + {%- if shop.shipping_policy.body != blank -%} + {{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }} + {%- endif -%} +
+ {%- endif -%} + +
+ {{ form | payment_terms }} +
+ + {% when 'liquid_code' %} + {% if block.settings.liquid != blank %} +
{{ block.settings.liquid }}
+ {% endif %} + + {% when 'local_pickup' %} + + {%- comment -%} + Live region for announcing updated price and availability to screen readers + {%- endcomment -%} +

+ + {%- comment -%} + Live region for announcing that the product form has been submitted and the + product is in the process being added to the cart + {%- endcomment -%} + + + +
+
+ + + {% when 'product_title' %} +

+ + {% if template.suffix == 'quick-view' %} + {{ product.title }} + {% else %} + {{ product.title }} + {% endif %} + +

+ + + {%- when 'rating' -%} + {%- if product.metafields.reviews.rating.value != blank -%} + {% liquid + assign rating_decimal = 0 + assign decimal = product.metafields.reviews.rating.value.rating | modulo: 1 + if decimal >= 0.3 and decimal <= 0.7 + assign rating_decimal = 0.5 + elsif decimal > 0.7 + assign rating_decimal = 1 + endif + %} + +

+ +

+

+ + {{ product.metafields.reviews.rating_count }} {{ "general.accessibility.total_reviews" | t }} +

+ {%- endif -%} + + + {% when 'product_description' %} + + {% if block.settings.desc_display == 'default' %} +
+ {{ product.description }} +
+ {% else %} + {% assign show_product_desc_full_width = true %} + {% endif %} + + {% when 'product_buttons' %} + + {%- if product.gift_card? and block.settings.show_gift_card_recipient -%} +
+
+
+ + +
+ +
+
+ + + +
+
+
+
+ {%- endif -%} + +
+
+ + {% if request.page_type != 'password' %} + + {% endif %} + + {% if block.settings.enable_payment_button %} + {{ form | payment_button }} + {% endif %} +
+ +
+ {{ 'products.product.pre_order_text' | t }} +
+
+ + + + + + + + {% when 'product_vendor'%} +
+ {{ 'products.product.vendor' | t }} + {{product.vendor | link_to_vendor}} + +
+ + {% when 'show_share_buttons' %} + {% render 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %} + + + {% when 'inventory_qty' %} + {% assign show_inventory_quantity = true %} + {% assign low_inventory_threshold = block.settings.low_inventory_threshold %} +
+ +
+ {%- if current_variant.available -%} + {%- if current_variant.inventory_management and current_variant.inventory_policy == 'deny' and block.settings.low_inventory_threshold > 0 -%} + {%- if current_variant.inventory_quantity <= block.settings.low_inventory_threshold -%} + + {% assign text = 'products.product.low_stock_with_quantity_count' | t: count: current_variant.inventory_quantity %} + {% assign icon = 'exclamation' %} + {% assign type = 'warning' %} + + {%- else -%} + {% assign text = 'products.product.in_stock_with_quantity_count' | t: count: current_variant.inventory_quantity %} + {% assign icon = 'check' %} + {% assign type = 'success' %} + + {%- endif -%} + {%- else -%} + + {% assign text = 'products.product.in_stock' | t %} + {% assign icon = 'check' %} + {% assign type = 'success' %} + + {%- endif -%} + {%- else -%} + + {% assign text = 'products.product.out_of_stock' | t %} + {% assign icon = 'x' %} + {% assign type = 'danger' %} + + {%- endif -%} + +
+
+
+ + + +
+
+ +
+
+
{{ text }}
+
+
+ + +
+ + {% when 'form_popup' %} + {% assign show_form_popup = true %} + + {% assign link_alignment = block.settings.link_alignment %} + {% assign link_color = block.settings.link_color %} + {% assign underline_link_title = block.settings.underline_link_title %} + + + + + {% when 'quantity_block' %} +
+
+
+ +
+ + + +
+
+
+
+ + {% when 'product_variations' %} + {%- liquid + assign contains_product = false + + for product_variation in block.settings.products + if product_variation == product + assign contains_product = true + endif + endfor + -%} + + {%- if contains_product -%} + {%- assign metafield_parts = block.settings.option_value_metafield | split: '.' -%} + {%- assign metafield_namespace = metafield_parts | first -%} + {%- assign metafield_key = metafield_parts | last -%} + + {% if block.settings.color_selector_type == 'dropdown' %} +
+
+ {% if block.settings.option_name != blank %} + + {% endif %} + +
+
+ {% else %} +
+
+
+ {% if block.settings.option_name != blank %} + +
{{ block.settings.option_name | escape }}:
+ {% endif %} +
+ {% for product_variation in block.settings.products %} + {% assign value = product_variation.metafields[metafield_namespace][metafield_key].value %} + + {% if product_variation == product %} + {% assign selected = true %} + {% else %} + {% assign selected = false %} + {% endif %} + + {% if block.settings.color_selector_type == 'block' %} + + + + {% elsif block.settings.color_selector_type == 'color' %} + + + {% if block.settings.show_tooltip and value != blank %} +
{{ value }}
+ {% endif %} +
+ {% elsif block.settings.color_selector_type == 'variant' %} + + + {% if block.settings.show_tooltip and value != blank %} +
{{ value }}
+ {% endif %} +
+ {% endif %} + {% endfor %} +
+
+
+
+ {% endif %} + {%- endif -%} + + {% when 'product_options_block' %} +
+ {% assign show_default_variant_input = false %} + + + {% unless product.has_only_default_variant %} +
+ {% for option in product.options_with_values %} +
+ + +
+ {% endfor %} +
+ {% if block.settings.show_product_swatches %} + + {% unless product.has_only_default_variant %} + + + {% if template.suffix != 'quick-view' %} + {% assign use_variant_image_for_swatches = block.settings.use_variant_image_for_swatches %} + {% else %} + {% assign use_variant_image_for_swatches = settings.use_variant_image_for_grid_swatches %} + {% endif %} +
+ {% for option in product.options_with_values %} + {% render 'swatch' swatch:option, forloop_index: forloop.index, use_variant_image_for_swatches:use_variant_image_for_swatches %} + {% endfor %} +
+ {% endunless %} + {% endif %} + {% endunless %} +
+ + {% when 'sku_block' %} + + + {% when 'image_with_text_blocks' %} + + {% assign image_with_text_blocks_color = block.settings.icon_color %} + +
+ {% for i in (1..3) %} + + {% capture link_handle %}link_{{i}}{% endcapture %} + {% capture text_handle %}text_{{i}}{% endcapture %} + {% capture image_handle %}image_{{i}}{% endcapture %} + {% capture show_block_handle %}show_block_{{i}}{% endcapture %} + {% capture icon_handle %}icon_{{i}}{% endcapture %} + + {% assign link = block.settings[link_handle] %} + {% assign text = block.settings[text_handle] %} + {% assign image = block.settings[image_handle] %} + {% assign icon_name = block.settings[icon_handle] %} + + {% assign show_block = block.settings[show_block_handle] %} + + {% if i == 1 %} + {% assign show_block = true %} + {% endif %} + + {% if show_block %} + + {% endif %} + {% endfor %} +
+ + {% when 'back_in_stock' %} +
+ +
+ +
+ + + + + +
+ +
+ + + {% else %} + {% if block.type contains 'collapsible_tab' %} + + + {% assign type = block.type | replace: 'collapsible_tab_', '' %} + + {%- case type -%} + + {%- when 'text' -%} +
+
+ + {{ block.settings.heading }} + +
+
+ {{ block.settings.content }} +
+
+
+
+ + {%- when 'page' -%} +
+
+ + {{ block.settings.heading | default: block.settings.page.title }} + +
+
+ {{ block.settings.page.content }} +
+
+
+
+ + {%- when 'desc' -%} + {% if product_description_in_static_tab == false %} + {% assign expanded_by_default = block.settings.expanded_by_default %} +
+
+ + {{ block.settings.heading }} + +
+
+ {{ product.description }} +
+
+
+
+ {% endif %} + + {%- when 'liquid' -%} +
+
+ + {{ block.settings.heading }} + +
+
+ {{ block.settings.content }} +
+
+
+
+ + {% endcase %} + + + {% endif %} + + {% endcase %} + {% endfor %} + + + {% if show_default_variant_input %} + + {% endif %} + {% endform %} + +
+ +
+
+ + + {% if show_product_desc_full_width %} + {% for block in section.blocks %} + {% if block.type == 'product_description' %} +
+ {{ product.description }} +
+ {% break %} + {% endif %} + {% endfor %} + {% endif %} + + {% if template.suffix != 'quick-view' %} + {% if show_static_tabs %} + {% assign static_tab_title_index = 1 %} + {% assign static_tab_text_index = 1 %} +
+ + + +
+ + {% for block in section.blocks %} + {% if block.type contains 'static_tab' %} + + {% assign type = block.type | replace: 'static_tab_', '' %} + + {%- case type -%} + {%- when 'text' -%} +
+
+ {% if block.settings.product_tab_content != '' %} + {{ block.settings.product_tab_content }} + {% else %} +

{{ 'products.general.tab_no_page' | t }}

+ {% endif %} +
+
+ + {%- when 'page' -%} +
+
+ {% if block.settings.page.content != '' %} + {{ block.settings.page.content }} + {% else %} +

{{ 'products.general.tab_no_page' | t }}

+ {% endif %} +
+
+ {%- when 'desc' -%} +
+
+ {{ product.description }} +
+
+ {%- when 'liquid' -%} +
+
+ {{ block.settings.content }} +
+
+ {% endcase %} + + {% assign static_tab_text_index = static_tab_text_index | plus: 1 %} + + {% endif %} + {% endfor %} + + + +
+
+
+ + {% for block in section.blocks %} + {% if block.type contains 'static_tab' %} + + {% assign type = block.type | replace: 'static_tab_', '' %} + +
+ + {% if type == 'page' %} + {{ block.settings.tab_title | escape | default: block.settings.page.title }} + {% else %} + {{ block.settings.tab_title | escape }} + {% endif %} + +
+ + + + {%- case type -%} + {%- when 'text' -%} +
+ {% if block.settings.product_tab_content != '' %} + {{ block.settings.product_tab_content }} + {% else %} +

{{ 'products.general.tab_no_page' | t }}

+ {% endif %} +
+ {%- when 'page' -%} +
+ {% if block.settings.page.content != '' %} + {{ block.settings.page.content }} + {% else %} +

{{ 'products.general.tab_no_page' | t }}

+ {% endif %} +
+ {%- when 'desc' -%} +
+ {{ product.description }} +
+ {%- when 'liquid' -%} +
+ {{ block.settings.content }} +
+ {% endcase %} + + +
+
+ + {% endif %} + {% endfor %} +
+ {% endif %} + {% endif %} + + + {% if enable_alts %} +
+
+ {%- for media in product.media -%} + {% if media.media_type == 'image' %} +
+ {% render 'media', media: media, featured_media: featured_media, height: height, image_scale: product_image_scale %} +
+ {% endif %} + {%- endfor -%} +
+ + {% if show_thumbnails %} +
+ {% for media in product.media %} + {% if media.media_type == 'image' %} + {% render 'thumb_media' media: media %} + {% endif %} + {% endfor %} +
+ {% endif %} + +
+ {% endif %} + +
+ + +{% unless product == empty %} + + + +{% endunless %} + + + + + +
+ {%- assign formId = 'ContactForm_' | append: product.id -%} + {% form 'contact', id: formId %} + +
+ {% assign success_message = 'products.product.notify_me_success_message' %} + {% render 'form-status', form: form, form_id: formId, success_message: success_message %} +
+ + + + + + +{% comment %} + + + + {% endcomment %} + + {% endform %} +
+ + + + +{% if show_form_popup %} +{% for block in section.blocks %} + {% if block.type == 'form_popup' %} + + {% assign image = block.settings.image %} + {% assign page_handle = block.settings.page %} + {% assign content = block.settings.content %} + + + + {% endif %} + {% endfor %} + {% endif %} + + +{{ 'component-rating.css' | asset_url | stylesheet_tag }} + +{% if enable_image_zoom %} + + +{% endif %} + + + +{% assign current_variant = product.selected_or_first_available_variant %} + + + + + + + + + + +{% schema %} +{ + "name": "t:sections.product-template.name", +"tag": "section", + "class": "section-product-template", + "settings": [ + { + "type":"checkbox", + "id":"show_breadcrumbs", + "label":"t:sections.product-template.settings.show_breadcrumbs.label", + "default": true + }, + { + "type":"checkbox", + "id":"show_pick_an_option", + "label":"t:sections.product-template.settings.show_pick_an_option.label", + "info":"t:sections.product-template.settings.show_pick_an_option.info", + "default": false + }, +{ + "type":"checkbox", + "id":"enabled_mobile_sticky_btns", + "label":"t:sections.product-template.settings.enabled_mobile_sticky_btns.label", + "default": true + }, + { + "type": "header", + "content": "t:sections.product-template.settings.header__2.content", + "info": "t:sections.product-template.settings.header__2.info" + }, + { + "type": "select", + "id": "media_size", + "label": "t:sections.product-template.settings.media_size.label", + "options": [ + { + "value": "small", + "label": "t:sections.product-template.settings.media_size.options__1.label" + }, + { + "value": "medium", + "label": "t:sections.product-template.settings.media_size.options__2.label" + }, + { + "value": "large", + "label": "t:sections.product-template.settings.media_size.options__3.label" + }, + { + "value": "full", + "label": "t:sections.product-template.settings.media_size.options__4.label" + } + ], + "default": "medium" + }, + { + "type": "checkbox", + "id": "enable_image_zoom", + "label": "t:sections.product-template.settings.enable_image_zoom.label", + "default": true + }, + { + "type": "checkbox", + "id": "enable_video_looping", + "label": "t:sections.product-template.settings.enable_video_looping.label", + "default": true + }, + { + "type": "checkbox", + "id": "enable_sticky_gallery_on_desktop", + "label": "t:sections.product-template.settings.enable_sticky_gallery_on_desktop.label" + }, + { + "type": "select", + "id": "thumbnails_type", + "label": "t:sections.product-template.settings.thumbnails_type.label", + "options": [ + { + "value": "grid", + "label": "t:sections.product-template.settings.thumbnails_type.options__1.label" + }, + { + "value": "carousel", + "label": "t:sections.product-template.settings.thumbnails_type.options__2.label" + }, + { + "value": "none", + "label": "t:sections.product-template.settings.thumbnails_type.options__3.label" + } + ], + "default":"grid" + }, +{ + "type": "range", + "id": "thumbnails_size", + "min": 1, + "max": 6, + "step": 1, + "label": "t:sections.product-template.settings.thumbnails_size.label", + "default": 4 + } + ], +"blocks": [ + { + "type": "@app" + }, + { + "type":"liquid_code", + "name":"t:sections.custom-liquid.name", + "settings": [ + { + "id": "liquid", + "type": "liquid", + "label": "t:sections.custom-liquid.settings.custom_liquid.label" + } + ] + }, +{ + "type":"collapsible_tab_desc", + "name":"t:sections.product-template.blocks.collapsible_tab_desc.name", + "settings": [ + { + "id": "heading", + "type": "text", + "label": "t:sections.product-template.blocks.collapsible_tab.settings.heading.label", + "default": "Accordion (description)" + }, + { + "id": "expanded_by_default", + "type": "checkbox", + "label": "t:sections.product-template.blocks.collapsible_tab_desc.settings.expanded_by_default.label" + } + ] + }, +{ + "type":"collapsible_tab_page", + "name":"t:sections.product-template.blocks.collapsible_tab_page.name", + "settings": [ + { + "id": "heading", + "type": "text", + "info": "t:sections.product-template.blocks.collapsible_tab.settings.heading.info", + "label": "t:sections.product-template.blocks.collapsible_tab.settings.heading.label", + "default": "Accordion (page)" + }, + { + "id": "page", + "type": "page", + "label": "t:sections.product-template.blocks.collapsible_tab.settings.page.label" + } + ] + }, +{ + "type":"collapsible_tab_liquid", + "name":"t:sections.product-template.blocks.collapsible_tab_reviews.name", + "settings": [ + { + "id": "heading", + "type": "text", + "info": "t:sections.product-template.blocks.collapsible_tab.settings.heading.info", + "label": "t:sections.product-template.blocks.collapsible_tab.settings.heading.label", + "default": "Accordion (liquid)" + }, + { + "id": "content", + "type": "liquid", + "label": "t:sections.custom-liquid.settings.custom_liquid.label" + } + ] + }, +{ + "type":"collapsible_tab_text", + "name":"t:sections.product-template.blocks.collapsible_tab_text.name", + "settings": [ + { + "id": "heading", + "type": "text", + "info": "t:sections.product-template.blocks.collapsible_tab.settings.heading.info", + "label": "t:sections.product-template.blocks.collapsible_tab.settings.heading.label", + "default": "Accordion (text)" + }, + { + "id": "content", + "type": "richtext", + "label": "t:sections.product-template.blocks.collapsible_tab.settings.content.label" + } + + ] + }, + +{ + "type":"back_in_stock", + "name":"t:sections.product-template.blocks.back_in_stock.name", + "settings": [] + }, +{ + "type":"product_buttons", + "name":"t:sections.product-template.blocks.product_buttons.name", + + "settings": [ + { + "type": "checkbox", + "id": "enable_payment_button", + "label": "t:sections.product-template.blocks.product_buttons.settings.enable_payment_button.label", + "info": "t:sections.product-template.blocks.product_buttons.settings.enable_payment_button.info", + "default": true + }, + { + "type": "checkbox", + "id": "show_gift_card_recipient", + "label": "t:sections.product-template.blocks.product_buttons.settings.show_gift_card_recipient.label", + "info": "t:sections.product-template.blocks.product_buttons.settings.show_gift_card_recipient.info", + "default": true + } +] + }, + { + "type": "complementary", + "name": "t:sections.product-template.blocks.complementary_products.name", + "limit": 1, + "settings": [ + { + "type": "paragraph", + "content": "t:sections.product-template.blocks.complementary_products.settings.paragraph.content" + }, + { + "type": "text", + "id": "block_heading", + "default": "Pairs well with", + "label": "t:sections.product-template.blocks.complementary_products.settings.heading.label" + }, + { + "type": "range", + "id": "product_list_limit", + "min": 1, + "max": 10, + "step": 1, + "default": 10, + "label": "t:sections.product-template.blocks.complementary_products.settings.product_list_limit.label" + }, + { + "type": "range", + "id": "products_per_page", + "min": 1, + "max": 4, + "step": 1, + "default": 3, + "label": "t:sections.product-template.blocks.complementary_products.settings.products_per_page.label" + }, + { + "type": "header", + "content": "t:sections.product-template.blocks.complementary_products.settings.product_card.heading" + }, + { + "type": "checkbox", + "id": "enable_quick_add", + "label": "t:sections.product-template.blocks.complementary_products.settings.enable_quick_add.label", + "default": false + } + ] + }, +{ + "type":"local_pickup", + "name":"t:sections.product-template.blocks.local_pickup.name", + "settings": [] + }, +{ + "type": "rating", + "name": "t:sections.product-template.blocks.rating.name", + "limit": 1, + "settings": [ + { + "type": "paragraph", + "content": "t:sections.product-template.blocks.rating.settings.paragraph.content" + } + ] + }, + { + "type":"form_popup", + "name":"t:sections.product-template.blocks.form_popup.name", + "settings": [ + { + "type":"text", + "id":"link_title", + "label": "t:sections.product-template.blocks.form_popup.settings.link_title.label", + "default": "Popup link" + }, + { + "type":"checkbox", + "id":"underline_link_title", + "label": "t:sections.product-template.blocks.form_popup.settings.underline_link_title.label", + "default":true + }, + { + "type":"text", + "id":"icon", + "label": "t:sections.product-template.blocks.form_popup.settings.icon.label", + "info": "t:sections.product-template.blocks.form_popup.settings.icon.info" + }, + { + "type":"color", + "id":"link_color", + "label": "t:sections.product-template.blocks.form_popup.settings.link_color.label", + "default":"#000" + }, + { + "type":"select", + "id":"link_alignment", + "label": "t:sections.product-template.blocks.form_popup.settings.link_alignment.label", + "options": [ + { + "value": "left", + "label": "t:sections.product-template.blocks.form_popup.settings.link_alignment.options__1.label" + }, + { + "value": "center", + "label": "t:sections.product-template.blocks.form_popup.settings.link_alignment.options__2.label" + }, + { + "value": "right", + "label": "t:sections.product-template.blocks.form_popup.settings.link_alignment.options__3.label" + } + ], + "default":"left" + }, + { + "type":"select", + "id":"content", + "label": "t:sections.product-template.blocks.form_popup.settings.content.label", + "options": [ + { + "value": "image", + "label": "t:sections.product-template.blocks.form_popup.settings.content.options__1.label" + }, + { + "value": "page", + "label": "t:sections.product-template.blocks.form_popup.settings.content.options__2.label" + } + ], + "default":"image" + }, + + { + "type":"image_picker", + "id":"image", + "label": "t:sections.product-template.blocks.form_popup.settings.image.label" + }, + { + "type":"page", + "id":"page", + "label": "t:sections.product-template.blocks.form_popup.settings.page.label" + } + + ] + }, +{ + "type":"product_price", + "name":"t:sections.product-template.blocks.product_price.name", + "settings": [] + }, + { + "type":"product_title", + "name":"t:sections.product-template.blocks.product_title.name", + "settings": [] + }, + { + "type":"product_description", + "name":"t:sections.product-template.blocks.product_description.name", + "settings": [ + + { + "type": "select", + "id": "desc_display", + "label": "t:sections.product-template.blocks.product_description.settings.desc_display.label", + "options": [ + { + "value": "default", + "label": "t:sections.product-template.blocks.product_description.settings.desc_display.options_1.label" + }, + { + "value": "full_width", + "label": "t:sections.product-template.blocks.product_description.settings.desc_display.options_2.label" + } + ], + "default": "default" + } + ] + }, + + + { + "type":"product_vendor", + "name":"t:sections.product-template.blocks.product_vendor.name", + "settings": [] + }, + + { + "type":"quantity_block", + "name":"t:sections.product-template.blocks.quantity_block.name", + "settings": [ + ] + }, +{ + "type":"sku_block", + "name":"t:sections.product-template.blocks.sku_block.name", + "settings": [] + }, +{ + "type":"show_share_buttons", + "name":"t:sections.product-template.blocks.show_share_buttons.name", + "settings": [] + }, + { + "type":"static_tab_desc", + "name":"t:sections.product-template.blocks.static_tab_desc.name", + "settings": [ + { + "id": "tab_title", + "type": "text", + "label": "t:sections.product-template.blocks.static_tab.settings.tab_title.label", + "default": "Decsription" + } + ] + }, + { + "type":"static_tab_page", + "name":"t:sections.product-template.blocks.static_tab_page.name", + "settings": [ + { + "id": "tab_title", + "type": "text", + "label": "t:sections.product-template.blocks.static_tab.settings.tab_title.label", + "default": "Title" + }, + { + "id": "page", + "type": "page", + "label": "t:sections.product-template.blocks.static_tab.settings.page.label" + } + ] + }, +{ + "type":"static_tab_liquid", + "name":"t:sections.product-template.blocks.static_tab_reviews.name", + "settings": [ + { + "id": "tab_title", + "type": "text", + "label": "t:sections.product-template.blocks.static_tab.settings.tab_title.label", + "default": "Liquid" + }, + { + "id": "content", + "type": "liquid", + "label": "t:sections.custom-liquid.settings.custom_liquid.label" + } + + ] + }, + { + "type":"static_tab_text", + "name":"t:sections.product-template.blocks.static_tab_text.name", + "settings": [ + { + "id": "tab_title", + "type": "text", + "label": "t:sections.product-template.blocks.static_tab.settings.tab_title.label", + "default": "Title" + }, + { + "id": "product_tab_content", + "type": "richtext", + "label": "t:sections.product-template.blocks.static_tab.settings.product_tab_content.label" + } + + ] + }, + + { + "type":"inventory_qty", + "name":"t:sections.product-template.blocks.inventory_qty.name", + "settings": [ + { + "type": "range", + "id": "low_inventory_threshold", + "label": "t:sections.product-template.blocks.inventory_qty.settings.low_inventory_threshold.label", + "info": "t:sections.product-template.blocks.inventory_qty.settings.low_inventory_threshold.info", + "min": 0, + "max": 100, + "step": 1, + "default": 0 + } + ] + }, + + +{ + "type":"image_with_text_blocks", +"name":"t:sections.product-template.blocks.image_with_text_blocks.name", +"limit": 1, +"settings": [ + { + "type":"color", + "id":"icon_color", + "label": "t:sections.product-template.blocks.image_with_text_blocks.settings.icon_color.label", + "default":"#000" + }, + { + "type": "header", + "content": "t:sections.product-template.blocks.image_with_text_blocks.content_1" + }, + { + "type": "text", + "id": "icon_1", + "label": "t:sections.product-template.blocks.image_with_text_blocks.settings.icon.label", + "info": "t:sections.product-template.blocks.image_with_text_blocks.settings.icon.info", + "default": "star" + }, + + { + "type":"image_picker", + "id":"image_1", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.image.label_1" + }, + { + "type":"text", + "id":"text_1", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.text.label_1" + }, + { + "type":"url", + "id":"link_1", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.link.label_1" + }, +{ + "type": "header", + "content": "t:sections.product-template.blocks.image_with_text_blocks.content_2" + }, +{ + "type":"checkbox", + "id":"show_block_2", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.show_block.label" + }, + { + "type": "text", + "id": "icon_2", + "label": "t:sections.product-template.blocks.image_with_text_blocks.settings.icon.label", + "info": "t:sections.product-template.blocks.image_with_text_blocks.settings.icon.info", + "default": "star" + }, +{ + "type":"image_picker", + "id":"image_2", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.image.label_2" + }, + { + "type":"text", + "id":"text_2", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.text.label_2" + }, + { + "type":"url", + "id":"link_2", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.link.label_2" + }, +{ + "type": "header", + "content": "t:sections.product-template.blocks.image_with_text_blocks.content_3" + }, +{ + "type":"checkbox", + "id":"show_block_3", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.show_block.label" + }, + { + "type": "text", + "id": "icon_3", + "label": "t:sections.product-template.blocks.image_with_text_blocks.settings.icon.label", + "info": "t:sections.product-template.blocks.image_with_text_blocks.settings.icon.info", + + "default": "star" + }, + +{ + "type":"image_picker", + "id":"image_3", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.image.label_3" + }, + { + "type":"text", + "id":"text_3", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.text.label_3" + }, + { + "type":"url", + "id":"link_3", + "label":"t:sections.product-template.blocks.image_with_text_blocks.settings.link.label_3" + } + + ] + }, + { + "type":"product_options_block", + "name":"t:sections.product-template.blocks.product_options_block.name", + "settings": [ + { + "type":"checkbox", + "id":"show_product_swatches", + "label":"t:sections.product-template.blocks.product_options_block.settings.show_product_swatches.label", + "info":"t:sections.product-template.blocks.product_options_block.settings.show_product_swatches.info", + "default": true + }, + { + "type":"checkbox", + "id":"use_variant_image_for_swatches", + "label":"t:sections.product-template.blocks.product_options_block.settings.use_variant_image_for_swatches.label", + "default": false + } +] + }, + { + "type": "product_variations", + "name": "t:sections.product-template.blocks.product_variations.name", + "settings": [ + { + "type": "paragraph", + "content": "t:sections.product-template.blocks.product_variations.instructions" + }, + { + "type": "text", + "id": "option_name", + "label": "t:sections.product-template.blocks.product_variations.option_name", + "placeholder": "t:sections.product-template.blocks.product_variations.option_name_placeholder" + }, + { + "type": "text", + "id": "option_value_metafield", + "label": "t:sections.product-template.blocks.product_variations.option_value_metafield", + "info": "t:sections.product-template.blocks.product_variations.option_value_metafield_info" + }, + { + "type": "product_list", + "id": "products", + "label": "t:sections.product-template.blocks.product_variations.product_list", + "info": "t:sections.product-template.blocks.product_variations.product_list_info" + }, + { + "type": "select", + "id": "color_selector_type", + "label": "t:sections.product-template.blocks.product_variations.color_selector_type", + "info": "t:sections.product-template.blocks.product_variations.color_selector_type_info", + "options": [ + { + "value": "block", + "label": "t:sections.product-template.blocks.product_variations.color_selector_type_options.block" + }, + { + "value": "dropdown", + "label": "t:sections.product-template.blocks.product_variations.color_selector_type_options.dropdown" + }, + { + "value": "color", + "label": "t:sections.product-template.blocks.product_variations.color_selector_type_options.color_swatch" + }, + { + "value": "variant", + "label": "t:sections.product-template.blocks.product_variations.color_selector_type_options.variant_image" + } + ], + "default": "color" + }, + { + "type": "select", + "id": "color_selector_size", + "label": "t:sections.product-template.blocks.product_variations.color_selector_size", + "info": "t:sections.product-template.blocks.product_variations.color_selector_size_info", + "options": [ + { + "value": "small", + "label": "t:sections.product-template.blocks.product_variations.color_selector_size_options.small" + }, + { + "value": "medium", + "label": "t:sections.product-template.blocks.product_variations.color_selector_size_options.medium" + }, + { + "value": "large", + "label": "t:sections.product-template.blocks.product_variations.color_selector_size_options.large" + } + ], + "default": "small" + }, + { + "type": "checkbox", + "id": "show_tooltip", + "label": "t:sections.product-template.blocks.product_variations.show_tooltip", + "info": "t:sections.product-template.blocks.product_variations.show_tooltip_info" + } + ] + } + ] +} +{% endschema %} diff --git a/snippets/product-price-listing.liquid b/snippets/product-price-listing.liquid new file mode 100644 index 0000000..77b9474 --- /dev/null +++ b/snippets/product-price-listing.liquid @@ -0,0 +1,124 @@ +{% comment %} + Renders a list of product's price (regular, sale, unit) + Accompanies product listings (collection page, search result) and not updated dynamically + Accepts: + - variant: {Object} Variant Liquid object (optional) + - product: {Object} Product Liquid object (optional) + + Usage: + {% render 'product-price-listing', product: product %} +{% endcomment %} +{%- liquid + if product.title + assign compare_at_price = product.compare_at_price + assign price = product.price + assign available = product.available + assign variant = product.variants.first + else + assign compare_at_price = 1999 + assign price = 1999 + assign available = true + endif + + comment + start Yagi app code + endcomment + if product.title + assign price = product.price + assign compare_at_price = product.compare_at_price + + assign price = product.metafields.app--168074346497.min_auto_discounted_price.value | default: product.price + + if price < product.price and compare_at_price == 0 or compare_at_price == blank + assign compare_at_price = product.price + endif + endif + comment + end Yagi app code + endcomment + +if settings.currency_code_enable + assign money_price = price | money_with_currency + else + assign money_price = price | money + endif + +-%} + +{% unless product.price_max == 0 and settings.custom_price0_text != blank or price == 0 and settings.custom_price0_text != blank %} +
+ +{% comment %} +{% render 'auto-discounted-price', product: product %} +{% endcomment %} + + +
+ + {{ 'products.product.regular_price' | t }} + + {%- if product.price_varies -%} + {{ 'products.product.from_lowest_price_html' | t: lowest_price: money_price }} + {%- else -%} + {{ money_price }} + {%- endif -%} + +
+
+ {{ 'products.product.sale_price' | t }} + + {%- if product.price_varies -%} + {{ 'products.product.from_lowest_price_html' | t: lowest_price: money_price }} + {%- else -%} + {{ money_price }} + {%- endif -%} + +
+ {{ 'products.product.regular_price' | t }} + + {% if settings.currency_code_enable %} + {{ compare_at_price | money_with_currency }} + {% else %} + {{ compare_at_price | money }} + {% endif %} + +
+
+
+ {{ 'products.product.unit_price_label' | t }} +
+ {%- 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 -%} + + + {% if settings.currency_code_enable %} + {{ variant.unit_price | money_with_currency }} + {% else %} + {{ variant.unit_price | money }} + {% endif %} + {{- unit_price_separator -}}{{- unit_price_base_unit -}} +
+
+
+ +{% else %} + + {{settings.custom_price0_text }} + +{% 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..1eec60d --- /dev/null +++ b/snippets/product-price.liquid @@ -0,0 +1,141 @@ +{% comment %} +Renders a list of product's price (regular, sale, unit) +Accompanies product forms and meant to be updated dynamically +Accepts: +- variant: {Object} Variant Liquid object (optional) +- product: {Object} Product Liquid object (optional) +- show_vendor: {Boolean} Show the product's vendor depending on the section setting (optional) + +Usage: +{% render 'product-price', variant: current_variant, product: product %} +{% endcomment %} +{%- liquid + if variant.title + assign compare_at_price = variant.compare_at_price + assign price = variant.price + assign available = variant.available + else + assign compare_at_price = 1999 + assign price = 1999 + assign available = true + endif + + comment + start Yagi app code + endcomment + if variant.title + assign price = variant.price + assign compare_at_price = variant.compare_at_price + + assign price = variant.metafields.app--168074346497.auto_discounted_price.value | default: variant.price + + if price < variant.price and compare_at_price == 0 or compare_at_price == blank + assign compare_at_price = variant.price + endif + endif + comment + end Yagi app code + endcomment + + +if settings.currency_code_enable + assign money_price = price | money_with_currency + else + assign money_price = price | money + endif + +-%} + +
+ + {% if show_vendor and product %} +
+ {{ 'products.product.vendor' | t }} + {{ product.vendor }} +
+ {% endif %} + + + {% unless product.price_max == 0 and settings.custom_price0_text != blank %} +
+
+ {{ 'products.product.regular_price' | t }} + + {% if price == 0 and settings.custom_price0_text != blank %} + + {{settings.custom_price0_text }} + + {% else %} + {{ money_price }} + {% endif %} + +
+
+ {{ 'products.product.sale_price' | t }} + + {% if price == 0 and settings.custom_price0_text != blank %} + + {{settings.custom_price0_text }} + + {% else %} + {{ money_price }} + {% endif %} + + + {{ 'products.product.regular_price' | t }} + + + {% if settings.currency_code_enable %} + {{ compare_at_price | money_with_currency }} + {% else %} + {{ compare_at_price | money }} + {% endif %} + + +
+
+ + {{ 'products.product.on_sale' | t }} + + + {{ 'products.product.sold_out' | t }} + +
+
+
+ {{ 'products.product.unit_price_label' | t }} +
+ {%- 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 -%} + + + {% if settings.currency_code_enable %} + {{ variant.unit_price | money_with_currency }} + {% else %} + {{ variant.unit_price | money }} + {% endif %} + {{- unit_price_separator -}}{{- unit_price_base_unit -}} +
+
+ {% else %} + + {{settings.custom_price0_text }} + + {% endunless %} +