commit 55a0ee52e935b49fdcd08631ff2ad194f63bb780 Author: Axel Date: Sun Nov 9 03:23:41 2025 +0800 first commit diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..75ca696 Binary files /dev/null and b/.DS_Store differ diff --git a/sections/product-template.liquid b/sections/product-template.liquid new file mode 100644 index 0000000..75b72fb --- /dev/null +++ b/sections/product-template.liquid @@ -0,0 +1,297 @@ +{% if section.settings.product_breadcrumb == false %} + {% style %} + .container .breadcrumb__wrapper { + display: none; + } + {% endstyle %} +{% endif %} + +
+
+
+ +
+ {% include 'product-images' %} +
+ +
+
{{ product.metafields.spr.reviews }}
+ {% assign collection_handles = product.collections | map: 'handle' %} + {% assign variant = product.selected_or_first_available_variant %} + {% assign variant_price = variant.price %} + {% assign variant_compare_at_price = variant.compare_at_price %} + + {%- liquid + assign variant_price = variant.metafields.app--168074346497.auto_discounted_price.value | default: variant.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 > variant_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 collection and section.settings.show_collection_link %} + + {{ collection.title }} + + {% endif %} + +

{{ product.title }}

+ +
+ {{ product.metafields.judgeme.badge }} +
+ + + + {% if settings.enable_shopify_product_badges %} + + {% endif %} + + {% if section.settings.display_vendor %} +

+ {{ product.vendor | link_to_vendor }} +

+ {% endif %} + + {% if variant.sku != blank and section.settings.display_sku %} +

+ {{ variant.sku }} +

+ {% endif %} + + {% if collection_handles contains 'coming-soon' %} + + {% else %} + + + {% include 'product-notify-me' %} + {% endif %} + + {% if section.settings.product_description_position == "top" %} + {% if product.description != blank %} +
+ {{ product.description | split: '' | first }} +
+ {% endif %} + {% endif %} + + {% unless collection_handles contains 'coming-soon' %} + {% include 'product-form' with 'product' %} + {% endunless %} + + {% if settings.enable_shopify_review_comments and settings.review_position == "top" %} +
{{ product.metafields.spr.reviews }}
+ {% endif %} + + {% if section.settings.product_description_position == "bottom" %} + {% if product.available %}
{% endif %} + {% if product.description != blank %} +
+ {{ product.description | split: '' | first }} +
+ {% endif %} + {% endif %} + + {% if section.settings.display_collections or section.settings.display_tags or section.settings.display_type %} +
+ {% endif %} + +
+ {% if section.settings.display_collections %} +

+ {{ 'products.product.collections' | t }}: + + {% for col in product.collections %} + {{ col.title }}{% unless forloop.last %},{% endunless %} + {% endfor %} + +

+ {% endif %} + + {% if section.settings.display_tags %} +

+ {% for tag in product.tags %} + {% if forloop.first %} + {{ 'products.product.tags' | t }}: + {% endif %} + + {% unless tag contains 'meta-' %} + + {{ tag }}{% unless forloop.last %},{% endunless %} + + {% endunless %} + {% endfor %} +

+ {% endif %} + + {% if section.settings.display_type %} +

+ {{ 'products.product.product_types' | t }}: {{ product.type | link_to_type }} +

+ {% endif %} + + {% if section.settings.display_vendor %} +

+ {{ 'products.product.vendor' | t }}: {{ product.vendor | link_to_vendor }} +

+ {% endif %} +
+ + {% include "social-buttons" with "product" %} +
+ +
+
+ +{% if product.description contains "" %} +
+
+
+ {{ product.description | split: '' | last }} +
+
+{% endif %} + +{% if settings.enable_shopify_review_comments and settings.review_position == "bottom" %} +
+
{{ product.metafields.spr.reviews }}
+
+{% endif %} +
+ +
+
+ {{ product.metafields.judgeme.widget }} +
+ + + +{% schema %} + +{ + "name": "Product", + "class": "product-template-section clearfix", + "settings": [ + { + "type": "checkbox", + "id": "product_breadcrumb", + "label": "Show breadcrumb links", + "default": true + }, + { + "type": "checkbox", + "id": "show_collection_link", + "label": "Show collection link", + "default": true + }, + { + "type": "checkbox", + "id": "display_sku", + "label": "Show SKU" + }, + { + "type": "checkbox", + "id": "display_tags", + "label": "Show tags" + }, + { + "type": "checkbox", + "id": "display_type", + "label": "Show type" + }, + { + "type": "checkbox", + "id": "display_vendor", + "label": "Show vendor" + }, + { + "type": "checkbox", + "id": "display_collections", + "label": "Show collections" + }, + { + "type": "checkbox", + "id": "display_social_buttons", + "label": "Show social media share icons", + "default": true + }, + { + "type": "radio", + "id": "product_description_position", + "label": "Description position", + "options": [ + { + "value": "top", + "label": "Above 'add to cart'" + }, + { + "value": "bottom", + "label": "Below 'add to cart'" + } + ] + }, + { + "type": "radio", + "id": "product_images_position", + "label": "Images position", + "options": [ + { + "value": "left", + "label": "Left" + }, + { + "value": "right", + "label": "Right" + } + ] + }, + { + "type": "header", + "content": "Dynamic checkout button" + }, + { + "type": "checkbox", + "id": "show_payment_button", + "label": "Show dynamic checkout button", + "default": true, + "info": "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)" + } + ] +} + +{% endschema %} diff --git a/snippets/product-thumbnail.liquid b/snippets/product-thumbnail.liquid new file mode 100644 index 0000000..d6c7db8 --- /dev/null +++ b/snippets/product-thumbnail.liquid @@ -0,0 +1,230 @@ +{% if sidebar %} +
+{% else %} +
+{% endif %} + + {% assign collection_handles = product.collections | map: 'handle' %} + + {% if product.featured_image.alt contains 'youtube' or image.alt contains 'vimeo' %} + {% assign alt_text = product.title %} + {% else %} + {% assign alt_text = product.featured_image.alt %} + {% endif %} + + {% if settings.align_height %} + {% assign collection_height = settings.collection_height | plus: 0 %} + {% assign product_aspect_ratio = product.featured_image.aspect_ratio | plus: 0 %} + {% assign product_set_width = product_aspect_ratio | times: collection_height %} + + {% if product.featured_image.width >= product.featured_image.height %} + {% assign align_height_value = 'width: 100%; height: auto;' %} + {% else %} + {% assign align_height_value = 'width: 100%;' %} + {% endif %} + + {% endif %} + + +
+ +
+
+ {% if settings.thumbnail_border_enabled %} +
+ {% endif %} + {{ alt_text | escape }} + {% if settings.collection_secondary_image != blank %} +
+ {{ alt_text | escape }} +
+ {% endif %} + {% if settings.thumbnail_border_enabled %} +
+ {% endif %} +
+
+ +
+ {% if settings.quick_shop_enabled %} + + {{ 'collections.general.quick_shop' | t }} + + {% endif %} +
+
+ +
+ {{ product.title }} + +
+ {{ product.metafields.judgeme.badge }} +
+ + {% if settings.enable_shopify_collection_badges %} + + {% endif %} + + {% if settings.display_vendor_collection %} + {{ product.vendor }} + {% endif %} + + {% if collection_handles contains 'coming-soon' %} +

{{ 'collections.general.coming_soon' | t }}

+ {% else %} + {%- liquid + assign product_price = product.metafields.app--168074346497.min_auto_discounted_price.value | default: product.price + assign product_price_min = product_price + assign product_compare_at_price_max = product.compare_at_price_max + + 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_price_min = product_price + + assign product_compare_at_price_max = product.price_max + + if product.compare_at_price_max > product_compare_at_price_max + assign product_compare_at_price_max = product.compare_at_price_max + endif + endif + + if product_price < product.price and product_compare_at_price_max == blank + assign product_compare_at_price_max = product.price_max + endif + -%} +

+ {% if product.available %} + {% if product.price_varies and product_price_min > 0 %} + {{ 'products.general.from' | t }} + {% endif %} + {% if product_price_min > 0 %} + {{ product_price_min | money }} + {% else %} + {{ settings.free_price_text }} + {% endif %} + {% if product_compare_at_price_max > product_price %} + + {{ product_compare_at_price_max | money }} + + {% endif %} + {% else %} + {{ 'products.product.sold_out' | t }} + {% endif %} +

+ {% endif %} + +
+ {% include 'product-thumbnail__sticker' %} +
+ {% include 'collection-swatch' %} +
+ +{% if settings.quick_shop_enabled %} + {% if product.description contains "#tab1" %} + {% assign tabs = true %} + {% else %} + {% assign tabs = false %} + {% endif %} + + +{% endif %}