From 803776ee6e858c0715ddc8b0314d8f48177a76eb Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Tue, 25 Nov 2025 21:14:50 +0100 Subject: [PATCH] fix: correct navigation links in shop error pages for multi-access routing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix broken links in shop error pages that were not respecting the base_url for multi-access routing (domain, subdomain, and path-based vendor access). Problem: - Links used `{{ base_url or '/' }}` pattern which incorrectly fell back to '/' - This broke navigation when accessing via path-based routing (e.g., /vendor/vendor1/) - Links like "Continue Shopping" and "View All Products" went to wrong URLs Solution: - Remove `or '/'` fallback since base_url is always provided by error_renderer.py - Add proper path prefixes (shop/, shop/products, shop/account/login, etc.) - Ensure all links use `{{ base_url }}shop/...` pattern Files Updated (10 templates): - base.html: Fixed default action buttons and contact links - 404.html: Fixed "Continue Shopping" and "View All Products" links - 401.html: Fixed login and register links to use shop/account/* paths - 403.html: Fixed login and home links - 400.html: Fixed home and contact links - 422.html: Fixed home and contact links - 429.html: Fixed home and contact links - 500.html: Fixed home and contact links - 502.html: Fixed home and contact links - generic.html: Fixed home and contact links Example fix: Before: href="{{ base_url or '/' }}shop/products" After: href="{{ base_url }}shop/products" Result for path-based access (/vendor/vendor1/): Before: /shop/products (wrong - ignores vendor context) After: /vendor/vendor1/shop/products (correct) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/templates/shop/errors/400.html | 4 ++-- app/templates/shop/errors/401.html | 6 +++--- app/templates/shop/errors/403.html | 6 +++--- app/templates/shop/errors/404.html | 6 +++--- app/templates/shop/errors/422.html | 4 ++-- app/templates/shop/errors/429.html | 4 ++-- app/templates/shop/errors/500.html | 4 ++-- app/templates/shop/errors/502.html | 4 ++-- app/templates/shop/errors/base.html | 6 +++--- app/templates/shop/errors/generic.html | 4 ++-- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/app/templates/shop/errors/400.html b/app/templates/shop/errors/400.html index 4f354421..cba0c209 100644 --- a/app/templates/shop/errors/400.html +++ b/app/templates/shop/errors/400.html @@ -18,11 +18,11 @@ {% if vendor %} diff --git a/app/templates/shop/errors/401.html b/app/templates/shop/errors/401.html index b8b484ac..2b138273 100644 --- a/app/templates/shop/errors/401.html +++ b/app/templates/shop/errors/401.html @@ -17,12 +17,12 @@ {% if vendor %} diff --git a/app/templates/shop/errors/403.html b/app/templates/shop/errors/403.html index 27ae0023..d2b9ac20 100644 --- a/app/templates/shop/errors/403.html +++ b/app/templates/shop/errors/403.html @@ -17,12 +17,12 @@ {% if vendor %} diff --git a/app/templates/shop/errors/404.html b/app/templates/shop/errors/404.html index d4ac4f5d..993f1cd2 100644 --- a/app/templates/shop/errors/404.html +++ b/app/templates/shop/errors/404.html @@ -17,12 +17,12 @@ {% if vendor %} diff --git a/app/templates/shop/errors/422.html b/app/templates/shop/errors/422.html index 995bbf2c..95579166 100644 --- a/app/templates/shop/errors/422.html +++ b/app/templates/shop/errors/422.html @@ -31,11 +31,11 @@ {% if vendor %} diff --git a/app/templates/shop/errors/429.html b/app/templates/shop/errors/429.html index 698d65d7..fa847eeb 100644 --- a/app/templates/shop/errors/429.html +++ b/app/templates/shop/errors/429.html @@ -26,11 +26,11 @@ {% if vendor %} diff --git a/app/templates/shop/errors/500.html b/app/templates/shop/errors/500.html index 9a47c218..12f190ed 100644 --- a/app/templates/shop/errors/500.html +++ b/app/templates/shop/errors/500.html @@ -17,12 +17,12 @@ {% if vendor %} diff --git a/app/templates/shop/errors/502.html b/app/templates/shop/errors/502.html index fd1619c8..09ada9e6 100644 --- a/app/templates/shop/errors/502.html +++ b/app/templates/shop/errors/502.html @@ -18,11 +18,11 @@ {% if vendor %} diff --git a/app/templates/shop/errors/base.html b/app/templates/shop/errors/base.html index f52ab3e9..dca7178a 100644 --- a/app/templates/shop/errors/base.html +++ b/app/templates/shop/errors/base.html @@ -171,8 +171,8 @@
{% block action_buttons %} - Continue Shopping - Contact Us + Continue Shopping + Contact Us {% endblock %}
@@ -180,7 +180,7 @@ diff --git a/app/templates/shop/errors/generic.html b/app/templates/shop/errors/generic.html index d1c4af3c..250b0dbc 100644 --- a/app/templates/shop/errors/generic.html +++ b/app/templates/shop/errors/generic.html @@ -15,12 +15,12 @@
{{ message }}
{% if vendor %}