From 3c27ca78b033ebef66ce794257234017d713e7d6 Mon Sep 17 00:00:00 2001 From: Mandel Olaiya Date: Sun, 26 Apr 2026 13:15:43 +0200 Subject: [PATCH] Use Carbasa webshop header when Oscar enabled --- mandelstudio/settings/base.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mandelstudio/settings/base.py b/mandelstudio/settings/base.py index a1938c8..a2d6df2 100644 --- a/mandelstudio/settings/base.py +++ b/mandelstudio/settings/base.py @@ -72,9 +72,11 @@ def _ensure_installed_app(app_label: str, *, before: str | None = None) -> None: INSTALLED_APPS.append(app_label) -# Prefer Carbasa's webshop templates whenever this project runs as a webshop. -# Ensures the full Carbasa webshop header (search, user bar, cart, megamenu). -if ocyan_config.is_webshop and importlib.util.find_spec("ocyan.plugin.carbasa.webshop"): +# Prefer Carbasa's webshop templates whenever Oscar is enabled. +# Ensures the full Carbasa webshop header (search, user bar, cart, megamenu), +# even when the environment doesn't mark the site as a webshop explicitly. +_oscar_enabled = any("ocyan.plugin.oscar" in app for app in INSTALLED_APPS) +if _oscar_enabled and importlib.util.find_spec("ocyan.plugin.carbasa.webshop"): _ensure_installed_app("ocyan.plugin.carbasa.webshop", before="ocyan.plugin.carbasa") # Keep Carbasa/Coyote defaults stable even when plugin settings are not