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>
33 lines
990 B
HTML
33 lines
990 B
HTML
{% extends "shop/errors/base.html" %}
|
|
|
|
{% block icon %}🔒{% endblock %}
|
|
|
|
{% block title %}403 - Access Restricted{% endblock %}
|
|
|
|
{% block content %}
|
|
{% if vendor and theme and theme.branding and theme.branding.logo %}
|
|
<img src="{{ theme.branding.logo }}" alt="{{ vendor.name }}" class="vendor-logo">
|
|
{% endif %}
|
|
|
|
<div class="error-icon">🔒</div>
|
|
<div class="status-code">403</div>
|
|
<div class="status-name">Access Restricted</div>
|
|
<div class="error-message">
|
|
This page requires authentication or special permissions to access. Please log in to continue.
|
|
</div>
|
|
|
|
<div class="action-buttons">
|
|
<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 }}shop/contact">Contact support</a>
|
|
</div>
|
|
|
|
{% if vendor %}
|
|
<div class="vendor-info">
|
|
{{ vendor.name }}
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %} |