summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2025-09-08 15:54:36 +0600
committerunwox <me@unwox.com>2025-09-08 16:05:33 +0600
commit5026f6e51f983dd05fec806ee84494d3b488f742 (patch)
tree943f8b6eee6eb9e8f2910038be1e7d221b3c6c0b /pages
parentcabcbdce77b71e24241e9aec2765501327592531 (diff)
fix price tags for pieces
Diffstat (limited to 'pages')
-rw-r--r--pages/shop/_product/index.fnl8
-rw-r--r--pages/shop/index.fnl5
2 files changed, 10 insertions, 3 deletions
diff --git a/pages/shop/_product/index.fnl b/pages/shop/_product/index.fnl
index 2904b61..c10a7d8 100644
--- a/pages/shop/_product/index.fnl
+++ b/pages/shop/_product/index.fnl
@@ -25,6 +25,7 @@
products.price_per AS \"price-per\",
products.type,
products.stock,
+ products.packaging,
products.published,
products.image1,
products.image2,
@@ -63,8 +64,11 @@
"")
[:div {:class "mb-0-5" :style "font-style: italic;"}
(or (dicts.label dicts.tea-type product.type) product.type) ", "
- [:strong {} (* 50 product.price-per) "₽ за 50 грамм "]
- (.. "(" product.price-per "₽ за 1 грамм)")]]
+ (if (= product.packaging "piece")
+ (HTML [:strong {} product.price-per "₽ за 1 шт. "])
+ (HTML [:span {}
+ [:strong {} (* 50 product.price-per) "₽ за 50 грамм "]
+ "(" product.price-per "₽ за 1 грамм)"]))]]
[:div {:class "mb-2"} "~~~"]
[:NO-ESCAPE (text->html product.description)]]
[:div {:class "product-page-imgs"}
diff --git a/pages/shop/index.fnl b/pages/shop/index.fnl
index bbe08fa..0e99bb9 100644
--- a/pages/shop/index.fnl
+++ b/pages/shop/index.fnl
@@ -16,6 +16,7 @@
products.published,
products.short_description as \"short-description\",
products.price_per AS \"price-per\",
+ products.packaging,
products.type,
products.image1,
products.image2,
@@ -70,7 +71,9 @@
[:a {:href item-url} [:h3 {:class "shop-item-title"} product.title]]
[:div {:style "font-style: italic; margin-bottom: 0.25rem;"}
(or (dicts.label dicts.tea-type product.type) product.type) ", "
- [:strong {} (* 50 product.price-per) "₽ за 50 гр. "]]
+ (if (= product.packaging "piece")
+ (HTML [:strong {} product.price-per "₽ за 1 шт."])
+ (HTML [:strong {} (* 50 product.price-per) "₽ за 50 гр. "]))]
;; [:div {:class "shop-item-price"}
;; [:form {:method "POST"}
;; [:input {:type "hidden" :name "name" :value product.name}]