summaryrefslogtreecommitdiff
path: root/pages/shop
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2025-09-14 21:27:56 +0600
committerunwox <me@unwox.com>2025-09-14 21:29:18 +0600
commit598578a314962c5b5ffdc73cd41e3add9adc52d7 (patch)
tree6515d052ec94e97fafe8af0b936fc8e802ab759c /pages/shop
parentd29f796b047c2a90db8f1e143d7da2a0159f9b7e (diff)
add volume to products
Diffstat (limited to 'pages/shop')
-rw-r--r--pages/shop/_product/edit.fnl1
-rw-r--r--pages/shop/_product/index.fnl4
-rw-r--r--pages/shop/add.fnl1
-rw-r--r--pages/shop/index.fnl4
4 files changed, 10 insertions, 0 deletions
diff --git a/pages/shop/_product/edit.fnl b/pages/shop/_product/edit.fnl
index 7e7548d..a8fd445 100644
--- a/pages/shop/_product/edit.fnl
+++ b/pages/shop/_product/edit.fnl
@@ -24,6 +24,7 @@
products.description,
products.price_per,
products.stock,
+ products.volume,
products.vendor,
products.vendor_article,
products.vendor_description,
diff --git a/pages/shop/_product/index.fnl b/pages/shop/_product/index.fnl
index 4bcf579..b4df0e5 100644
--- a/pages/shop/_product/index.fnl
+++ b/pages/shop/_product/index.fnl
@@ -27,6 +27,7 @@
products.type,
products.region,
products.stock,
+ products.volume,
products.packaging,
products.published,
products.year,
@@ -66,6 +67,9 @@
(if (not (lib.empty? product.year))
(HTML [:span {} [:NO-ESCAPE (.. product.year "&nbsp;год, ")]])
"")
+ (if (not (lib.empty? product.volume))
+ (HTML [:span {} [:NO-ESCAPE (.. product.volume "&nbsp;мл., ")]])
+ "")
(if (not (lib.empty? product.region)) (.. product.region ", ") "")
(if (= product.packaging "piece")
(HTML [:strong {} product.price-per "₽"])
diff --git a/pages/shop/add.fnl b/pages/shop/add.fnl
index 5d41793..b5fa8de 100644
--- a/pages/shop/add.fnl
+++ b/pages/shop/add.fnl
@@ -21,6 +21,7 @@
(tonumber (os.date "%Y")) "Для чая.")
(forms.select-input "season" "Сезон изготовления" false dicts.tea-season
"Для чая.")
+ (forms.number-input "volume" "Объем" false 0 2000 "В мл. Для посуды.")
(forms.text-input "region" "Место изготовления" false 0 500)
(forms.textarea-input "short_description" "Короткое описание" true 0 1000
"Суть и основные качества товара в одном предложении.")
diff --git a/pages/shop/index.fnl b/pages/shop/index.fnl
index 5c1d734..bd3e88b 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.volume,
products.packaging,
products.type,
products.image1,
@@ -76,6 +77,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.product-type product.type) product.type) ", "
+ (if (not (lib.empty? product.volume))
+ (HTML [:span {} [:NO-ESCAPE (.. product.volume "&nbsp;мл., ")]])
+ "")
(if (= product.packaging "piece")
(HTML [:strong {} product.price-per "₽"])
(HTML [:strong {} (* 50 product.price-per) "₽ за 50 гр. "]))]