From e19c0888e58fe824bee9a0eaa0708b34d812c671 Mon Sep 17 00:00:00 2001 From: Axel Date: Wed, 17 Jun 2026 00:34:49 +0800 Subject: [PATCH] first commit --- .DS_Store | Bin 0 -> 6148 bytes snippets/product-info.liquid | 187 +++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 .DS_Store create mode 100644 snippets/product-info.liquid diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c456dcce78f52b49517b202cd28f32175bd3d938 GIT binary patch literal 6148 zcmeHKu};G<5WRyAkytu1dS%QXgeo1G@&l+80a8OE6}ArfBR+%QVPxbz-%&L*0|P<` z-9`30+jnRCNwIw*qKoHsDKZz40)?nlCWPISLnm%L18R=Z%dI@gc5_!Y6M_C>7uR0M zRvzU+dVKr!-*jz%u;3$`wyW#ard!ef;^pdn_x5@@6|3#m-?HoP%jV0R2h)cd37Y|V3>~%R5=9z@)?~4I&%s7B*)5eFvJK% z%@t^_>M4erJNlE`RgQz9xr=)8p+56x@}hZm#825=v@(o37zhT&44hhX&ij9fUuH7N zAG<^=7zhUb83Q`2n|gsw`Q3W7J>Inm`sfjW2G5c6JZR&II_xUP!H`kd RpWT7+5Xgi?6%70W10RtoFw6h| literal 0 HcmV?d00001 diff --git a/snippets/product-info.liquid b/snippets/product-info.liquid new file mode 100644 index 0000000..f8f26dd --- /dev/null +++ b/snippets/product-info.liquid @@ -0,0 +1,187 @@ +{% assign variant = product.selected_or_first_available_variant %} + +{% liquid + comment + Yagi automatic discount helper app code + endcomment + assign product_price = product.metafields.app--168074346497.min_auto_discounted_price.value | default: product.price + assign product_price_min = product_price + assign product_price_max = product.price_max + assign product_compare_at_price = product.compare_at_price + assign product_compare_at_price_min = product.compare_at_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_price_max = product.price_max | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil + + assign product_compare_at_price = product.price + assign product_compare_at_price_max = product.price_max + + if product.compare_at_price > product_compare_at_price + assign product_compare_at_price = product.compare_at_price + assign product_compare_at_price_min = product_compare_at_price + endif + + if product.compare_at_price_max > product_compare_at_price_max + assign product_compare_at_price_max = product.price_max + endif + endif +%} + + +
+ + {{- product.title | escape -}} + + {% if settings.display_vendor %} + + {{ product.vendor }} + + {% endif %} + + {% if settings.show_star_ratings and product.metafields.reviews.rating.value != blank %} +
+ {% + render 'rating-stars', + value: product.metafields.reviews.rating.value.rating, + scale_max: product.metafields.reviews.rating.value.scale_max, + %} +

+ +

+

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

+
+ {% endif %} + + {% if collection_handles contains 'coming-soon' %} + {{ 'collections.general.coming_soon' | t }} + {% else %} + {% if settings.quick_shop_enabled and settings.quick_shop_style == 'inline' %} + {% comment %}Inject @pixelunion/shopify-price-ui/price-ui begin{% endcomment %} +
+ + {% assign compare_at_price = false %} + + {% if product_compare_at_price and product_compare_at_price != product_price %} + {% if product.compare_at_price_varies %} + {%- capture price_min -%} + {%- + render 'price-ui-templates', + template: 'price-min', + value: product_compare_at_price_min, + -%} + {%- endcapture -%} + + {%- capture price_max -%} + {%- + render 'price-ui-templates', + template: 'price-max', + value: product_compare_at_price_max, + -%} + {%- endcapture -%} + + {%- assign compare_at_price = 'product.price.range_html' | t: price_min: price_min, price_max: price_max -%} + {% else %} + {%- capture compare_at_price -%} + {%- + render 'price-ui-templates', + template: 'price', + value: product_compare_at_price, + -%} + {%- endcapture -%} + {% endif %} + {% endif %} + + {% if product.price_varies %} + {%- capture price_min -%} + {%- + render 'price-ui-templates', + template: 'price-min', + value: product_price_min, + -%} + {%- endcapture -%} + + {%- capture price_max -%} + {%- + render 'price-ui-templates', + template: 'price-max', + value: product_price_max, + -%} + {%- endcapture -%} + + {%- assign price = 'product.price.range_html' | t: price_min: price_min, price_max: price_max -%} + {% else %} + {%- capture price -%} + {%- + render 'price-ui-templates', + template: 'price', + value: product_price, + -%} + {%- endcapture -%} + {% endif %} + + {%- + render 'price-ui-templates', + template: 'price-ui', + compare_at_price: compare_at_price, + price: price, + unit_pricing: false, + -%} +
+ {% comment %}Inject @pixelunion/shopify-price-ui/price-ui end{% endcomment %} + + {% else %} + + {% unless product.available == false and settings.display_price == false %} + + {% if product.price_varies %} + {{ 'products.general.from' | t }} + {% endif %} + {% if product.price_min > 0 %} + {% render 'price-element', price: product_price_min %} + {% else %} + {% if settings.free_price_text != blank %} + {{ settings.free_price_text }} + {% else %} + {% render 'price-element', price: product_price_min %} + {% endif %} + {% endif %} + + + {% if product_price < product_compare_at_price %} + {% render 'price-element', price: product_compare_at_price %} + {% endif %} + + {% endunless %} +
+ {% unless product.available %} + {{ 'products.product.sold_out' | t }} + {% endunless %} +
+
+ {% endif %} + {% endif %} + {% if settings.quick_shop_enabled and settings.quick_shop_style == 'popup' %} + {% + render 'unit-price', + item: variant, + variant: product, + product: product, + class: 'product-details__unit-price' + %} + {% endif %} +
\ No newline at end of file