From 2efc05957edc009d86227760d7848a1dbf2a8371 Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 18 Feb 2026 21:49:42 +0000 Subject: [PATCH] Fix cart badge to include calendar entries in count Context processor now sums product count + calendar_count from the cart API, so the cart badge shows the correct total on all pages. Co-Authored-By: Claude Opus 4.6 --- app.py | 6 +++--- shared | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index acc41cc..28c13e5 100644 --- a/app.py +++ b/app.py @@ -35,11 +35,11 @@ async def coop_context() -> dict: ctx["menu_items"] = await get_navigation_tree(g.s) - # Cart data from cart app API + # Cart data from cart app API (includes both product + calendar counts) cart_data = await api_get("cart", "/internal/cart/summary", forward_session=True) if cart_data: - ctx["cart_count"] = cart_data.get("count", 0) - ctx["cart_total"] = cart_data.get("total", 0) + ctx["cart_count"] = cart_data.get("count", 0) + cart_data.get("calendar_count", 0) + ctx["cart_total"] = cart_data.get("total", 0) + cart_data.get("calendar_total", 0) else: ctx["cart_count"] = 0 ctx["cart_total"] = 0 diff --git a/shared b/shared index 0c0f3c8..e3f8ff6 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit 0c0f3c84167ff61ad469e1f5ad93de7841c59e76 +Subproject commit e3f8ff6e3c29c0506398604fc3aa4262138f484a