Fix cart badge: include calendar entries + OOB update on add
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 50s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 50s
- Context processor now sums product + calendar counts from cart API - add_entry route returns OOB cart-mini swap with correct count, querying pending entries from local session (sees uncommitted entry) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
6
app.py
6
app.py
@@ -27,11 +27,11 @@ async def events_context() -> dict:
|
||||
|
||||
ctx["menu_items"] = await get_navigation_tree(g.s)
|
||||
|
||||
# Cart data from cart API
|
||||
# Cart data from cart 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
|
||||
|
||||
Reference in New Issue
Block a user