fix: correct navigation links in shop error pages for multi-access routing
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 <noreply@anthropic.com>
This commit is contained in:
@@ -18,11 +18,11 @@
|
||||
|
||||
<div class="action-buttons">
|
||||
<a href="javascript:history.back()" class="btn btn-primary">Go Back</a>
|
||||
<a href="{{ base_url or '/' }}" class="btn btn-secondary">Go to Home</a>
|
||||
<a href="{{ base_url }}shop/" class="btn btn-secondary">Go to Home</a>
|
||||
</div>
|
||||
|
||||
<div class="support-link">
|
||||
Need help? <a href="{{ base_url or '/' }}contact">Contact us</a>
|
||||
Need help? <a href="{{ base_url }}shop/contact">Contact us</a>
|
||||
</div>
|
||||
|
||||
{% if vendor %}
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
</div>
|
||||
|
||||
<div class="action-buttons">
|
||||
<a href="{{ base_url or '/' }}login" class="btn btn-primary">Log In</a>
|
||||
<a href="{{ base_url or '/' }}register" class="btn btn-secondary">Create Account</a>
|
||||
<a href="{{ base_url }}shop/account/login" class="btn btn-primary">Log In</a>
|
||||
<a href="{{ base_url }}shop/account/register" class="btn btn-secondary">Create Account</a>
|
||||
</div>
|
||||
|
||||
<div class="support-link">
|
||||
Don't have an account? <a href="{{ base_url or '/' }}register">Sign up now</a>
|
||||
Don't have an account? <a href="{{ base_url }}shop/account/register">Sign up now</a>
|
||||
</div>
|
||||
|
||||
{% if vendor %}
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
</div>
|
||||
|
||||
<div class="action-buttons">
|
||||
<a href="{{ base_url or '/' }}login" class="btn btn-primary">Log In</a>
|
||||
<a href="{{ base_url or '/' }}" class="btn btn-secondary">Go to Home</a>
|
||||
<a href="{{ base_url }}shop/account/login" class="btn btn-primary">Log In</a>
|
||||
<a href="{{ base_url }}shop/" class="btn btn-secondary">Go to Home</a>
|
||||
</div>
|
||||
|
||||
<div class="support-link">
|
||||
Need help accessing your account? <a href="{{ base_url or '/' }}contact">Contact support</a>
|
||||
Need help accessing your account? <a href="{{ base_url }}shop/contact">Contact support</a>
|
||||
</div>
|
||||
|
||||
{% if vendor %}
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
</div>
|
||||
|
||||
<div class="action-buttons">
|
||||
<a href="{{ base_url or '/' }}shop/" class="btn btn-primary">Continue Shopping</a>
|
||||
<a href="{{ base_url or '/' }}shop/products" class="btn btn-secondary">View All Products</a>
|
||||
<a href="{{ base_url }}shop/" class="btn btn-primary">Continue Shopping</a>
|
||||
<a href="{{ base_url }}shop/products" class="btn btn-secondary">View All Products</a>
|
||||
</div>
|
||||
|
||||
<div class="support-link">
|
||||
Can't find what you're looking for? <a href="{{ base_url or '/' }}shop/contact">Contact us</a> and we'll help you find it.
|
||||
Can't find what you're looking for? <a href="{{ base_url }}shop/contact">Contact us</a> and we'll help you find it.
|
||||
</div>
|
||||
|
||||
{% if vendor %}
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
|
||||
<div class="action-buttons">
|
||||
<a href="javascript:history.back()" class="btn btn-primary">Go Back and Fix</a>
|
||||
<a href="{{ base_url or '/' }}" class="btn btn-secondary">Go to Home</a>
|
||||
<a href="{{ base_url }}shop/" class="btn btn-secondary">Go to Home</a>
|
||||
</div>
|
||||
|
||||
<div class="support-link">
|
||||
Having trouble? <a href="{{ base_url or '/' }}contact">We're here to help</a>
|
||||
Having trouble? <a href="{{ base_url }}shop/contact">We're here to help</a>
|
||||
</div>
|
||||
|
||||
{% if vendor %}
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
|
||||
<div class="action-buttons">
|
||||
<a href="javascript:location.reload()" class="btn btn-primary">Try Again</a>
|
||||
<a href="{{ base_url or '/' }}" class="btn btn-secondary">Go to Home</a>
|
||||
<a href="{{ base_url }}shop/" class="btn btn-secondary">Go to Home</a>
|
||||
</div>
|
||||
|
||||
<div class="support-link">
|
||||
Questions? <a href="{{ base_url or '/' }}contact">Contact us</a>
|
||||
Questions? <a href="{{ base_url }}shop/contact">Contact us</a>
|
||||
</div>
|
||||
|
||||
{% if vendor %}
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
</div>
|
||||
|
||||
<div class="action-buttons">
|
||||
<a href="{{ base_url or '/' }}" class="btn btn-primary">Go to Home</a>
|
||||
<a href="{{ base_url }}shop/" class="btn btn-primary">Go to Home</a>
|
||||
<a href="javascript:location.reload()" class="btn btn-secondary">Try Again</a>
|
||||
</div>
|
||||
|
||||
<div class="support-link">
|
||||
Issue persisting? <a href="{{ base_url or '/' }}contact">Let us know</a> and we'll help you out.
|
||||
Issue persisting? <a href="{{ base_url }}shop/contact">Let us know</a> and we'll help you out.
|
||||
</div>
|
||||
|
||||
{% if vendor %}
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
<div class="action-buttons">
|
||||
<a href="javascript:location.reload()" class="btn btn-primary">Try Again</a>
|
||||
<a href="{{ base_url or '/' }}" class="btn btn-secondary">Go to Home</a>
|
||||
<a href="{{ base_url }}shop/" class="btn btn-secondary">Go to Home</a>
|
||||
</div>
|
||||
|
||||
<div class="support-link">
|
||||
If this continues, <a href="{{ base_url or '/' }}contact">let us know</a>
|
||||
If this continues, <a href="{{ base_url }}shop/contact">let us know</a>
|
||||
</div>
|
||||
|
||||
{% if vendor %}
|
||||
|
||||
@@ -171,8 +171,8 @@
|
||||
|
||||
<div class="action-buttons">
|
||||
{% block action_buttons %}
|
||||
<a href="{{ base_url or '/' }}" class="btn btn-primary">Continue Shopping</a>
|
||||
<a href="{{ base_url or '/' }}contact" class="btn btn-secondary">Contact Us</a>
|
||||
<a href="{{ base_url }}shop/" class="btn btn-primary">Continue Shopping</a>
|
||||
<a href="{{ base_url }}shop/contact" class="btn btn-secondary">Contact Us</a>
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
|
||||
<div class="support-link">
|
||||
{% block support_link %}
|
||||
Need help? <a href="{{ base_url or '/' }}contact">Contact our support team</a>
|
||||
Need help? <a href="{{ base_url }}shop/contact">Contact our support team</a>
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<div class="error-message">{{ message }}</div>
|
||||
|
||||
<div class="action-buttons">
|
||||
<a href="{{ base_url or '/' }}" class="btn btn-primary">Continue Shopping</a>
|
||||
<a href="{{ base_url }}shop/" class="btn btn-primary">Continue Shopping</a>
|
||||
<a href="javascript:history.back()" class="btn btn-secondary">Go Back</a>
|
||||
</div>
|
||||
|
||||
<div class="support-link">
|
||||
Need assistance? <a href="{{ base_url or '/' }}contact">Contact us</a>
|
||||
Need assistance? <a href="{{ base_url }}shop/contact">Contact us</a>
|
||||
</div>
|
||||
|
||||
{% if vendor %}
|
||||
|
||||
Reference in New Issue
Block a user