From 3a1ea7cdb45d8826dd0fc2a0e9009f3a901ca780 Mon Sep 17 00:00:00 2001 From: Priec Date: Mon, 22 Jun 2026 16:14:04 +0200 Subject: [PATCH] I can see the product with different options --- assets/i18n/en/main.ftl | 1 + assets/i18n/sk/main.ftl | 1 + assets/views/admin/catalog/product_form.html | 31 +++++++++----------- assets/views/shop/show.html | 25 ++++++++-------- src/controllers/admin_products.rs | 13 ++++---- 5 files changed, 34 insertions(+), 37 deletions(-) diff --git a/assets/i18n/en/main.ftl b/assets/i18n/en/main.ftl index 72683cc..e042d65 100644 --- a/assets/i18n/en/main.ftl +++ b/assets/i18n/en/main.ftl @@ -212,6 +212,7 @@ sale-price = Sale price variants-options = Variants / options add-option = Add option option-label = Option label +optional = optional choose-option = Choose an option from-price = from { $price } admin-discounts = Discounts diff --git a/assets/i18n/sk/main.ftl b/assets/i18n/sk/main.ftl index 776cb2e..b107e58 100644 --- a/assets/i18n/sk/main.ftl +++ b/assets/i18n/sk/main.ftl @@ -212,6 +212,7 @@ sale-price = Zľavnená cena variants-options = Varianty / možnosti add-option = Pridať možnosť option-label = Označenie možnosti +optional = voliteľné choose-option = Vyberte možnosť from-price = od { $price } admin-discounts = Zľavy diff --git a/assets/views/admin/catalog/product_form.html b/assets/views/admin/catalog/product_form.html index 7c28fbb..704df02 100644 --- a/assets/views/admin/catalog/product_form.html +++ b/assets/views/admin/catalog/product_form.html @@ -37,9 +37,11 @@ {# --- Variants / options editor ------------------------------------------- #} {# Each product is sold as one or more variants (a free-text label such as #} - {# "10cm x 13cm" or "5ml" plus its own price/stock/sku, and optional public & #} - {# business sale prices). Rows are managed client-side; names are indexed #} - {# (variants[i][...]) and read back by the controller. #} + {# "10cm x 13cm" or "5ml" plus its own price/stock, optional sku & business #} + {# price). Price and stock are required; the browser blocks save if a row is #} + {# incomplete. Rows are managed client-side; names are indexed (variants[i][…]) #} + {# and read back by the controller. #} + {% set opt = " (" ~ t(key="optional", lang=lang | default(value='sk')) ~ ")" %}
@@ -55,32 +57,28 @@
- +
- +
- +
-
+
- +
-
- - -
-
- +
+
@@ -89,15 +87,14 @@