From 7f7cc72647270168962a7b598d78311c8178f38d Mon Sep 17 00:00:00 2001 From: Krzysiej Date: Fri, 13 Feb 2026 08:18:51 +0100 Subject: [PATCH 1/4] Badges as links --- templates/productList.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/productList.html.twig b/templates/productList.html.twig index 2945194..3666967 100644 --- a/templates/productList.html.twig +++ b/templates/productList.html.twig @@ -48,7 +48,7 @@ data-bs-title="Last update: {{ product.lastSeen }}">is discontinued {% endif %} {% if product.isNew() %} - is new + is new {% endif %} Date: Sun, 15 Feb 2026 11:51:00 +0100 Subject: [PATCH 2/4] Badges as links --- templates/productList.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/productList.html.twig b/templates/productList.html.twig index 3666967..f0c74d8 100644 --- a/templates/productList.html.twig +++ b/templates/productList.html.twig @@ -44,8 +44,8 @@ out of stock {% endif %} {% if product.isDiscontinued() %} - is discontinued + is discontinued {% endif %} {% if product.isNew() %} is new -- 2.52.0 From d18c735b6353b2d43e98d7b34c4ece48d648df30 Mon Sep 17 00:00:00 2001 From: Krzysiej Date: Mon, 16 Feb 2026 08:59:46 +0100 Subject: [PATCH 3/4] Add locale badges to promos --- src/Controller/PromosController.php | 5 ++++- templates/productList.html.twig | 14 +++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Controller/PromosController.php b/src/Controller/PromosController.php index f3f277f..8e5fe05 100644 --- a/src/Controller/PromosController.php +++ b/src/Controller/PromosController.php @@ -20,8 +20,11 @@ final class PromosController extends BaseController $promos = Product::select($this->database->getConnection()->raw("distinct json_extract(promotions, '$.slug') as slug, json_extract(promotions, '$.tag') as tag")) + ->addSelect('countries.locale') ->whereRaw("json_extract(promotions, '$.tag') is not null") - ->get(); + ->join('countries', 'products.country_id', '=', 'countries.id') + ->get() + ->groupBy('locale'); return $this->render('productList.html.twig', ['products' => $products, 'listType' => 'promos' . $promo, 'promos' => $promos->toArray()]); } diff --git a/templates/productList.html.twig b/templates/productList.html.twig index f0c74d8..687ca59 100644 --- a/templates/productList.html.twig +++ b/templates/productList.html.twig @@ -6,9 +6,17 @@ {% endif %} {% if listType starts with 'promos' %} - {% for promo in promos %} - PROMO: {{ promo.tag }} - {% endfor %} + {% endif %} -- 2.52.0 From 6cfee98a6b149b7c01efafae0ffb74030b4e49f3 Mon Sep 17 00:00:00 2001 From: Krzysiej Date: Wed, 18 Feb 2026 07:49:50 +0100 Subject: [PATCH 4/4] Country badge. --- templates/productList.html.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/productList.html.twig b/templates/productList.html.twig index 687ca59..0f5f595 100644 --- a/templates/productList.html.twig +++ b/templates/productList.html.twig @@ -46,6 +46,7 @@ {{ product.name }} +
{% if product.stock > 0 %} stock: {{ product.stock }} {% else %} @@ -62,6 +63,7 @@ href="{{ path('app_search', {'search': product.subTitle}) }}" class="link-underline link-underline-opacity-0 link-dark">{{ product.subTitle }}
{% if product.promotions is not null and product.promotions.hasPromotion %}PROMO: {{ product.promotions.tag }}{% endif %} + {{ product.country.countryName }}