docs: add consolidated dev URL reference and migrate /shop to /storefront
Some checks failed
CI / ruff (push) Successful in 10s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled

- Add Development URL Quick Reference section to url-routing overview
  with all login URLs, entry points, and full examples
- Replace /shop/ path segments with /storefront/ across 50 docs files
- Update file references: shop_pages.py → storefront_pages.py,
  templates/shop/ → templates/storefront/, api/v1/shop/ → api/v1/storefront/
- Preserve domain references (orion.shop) and /store/ staff dashboard paths
- Archive docs left unchanged (historical)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 13:23:44 +01:00
parent 3df75e2e78
commit d648c921b7
50 changed files with 1104 additions and 1049 deletions

View File

@@ -1,6 +1,6 @@
# Shop Frontend Troubleshooting
# Storefront Troubleshooting
Common issues and solutions for the store shop frontend.
Common issues and solutions for the store storefront.
## Cart and Product Issues
@@ -78,7 +78,7 @@ async init() {
**Verify Fix:**
Open browser console and check for:
```
🔍 [SHOP] Session ID: session_1763765104510_zc866tt5d
🔍 [STOREFRONT] Session ID: session_1763765104510_zc866tt5d
```
If you see `undefined`, the parent init isn't being called properly.
@@ -95,11 +95,11 @@ If you see `undefined`, the parent init isn't being called properly.
- Page is just plain HTML
**Root Cause:**
Template doesn't extend `shop/base.html` and has hardcoded non-existent CSS references.
Template doesn't extend `storefront/base.html` and has hardcoded non-existent CSS references.
**How it Works:**
- All shop pages should extend `shop/base.html`
- Base template includes Tailwind CSS and shop styles
- All storefront pages should extend `storefront/base.html`
- Base template includes Tailwind CSS and storefront styles
- Standalone HTML pages with `<link>` tags won't work
**Solution:**
@@ -118,7 +118,7 @@ Refactor template to extend base:
</html>
{# AFTER: Extends base #}
{% extends "shop/base.html" %}
{% extends "storefront/base.html" %}
{% block title %}My Page{% endblock %}
@@ -130,16 +130,16 @@ Refactor template to extend base:
```
**Templates Already Fixed:**
-`shop/product.html` - Refactored to extend base
-`shop/cart.html` - Refactored to extend base
-`shop/products.html` - Already extends base
-`shop/home.html` - Already extends base
-`storefront/product.html` - Refactored to extend base
-`storefront/cart.html` - Refactored to extend base
-`storefront/products.html` - Already extends base
-`storefront/home.html` - Already extends base
### Images Not Loading / Placeholder Not Showing
**Symptoms:**
- Product images show broken image icon
- Console shows 404: `/static/shop/img/placeholder.jpg`
- Console shows 404: `/static/storefront/img/placeholder.jpg`
- OR images point to fake URLs like `https://orion.example.com/images/product-1.jpg`
**Root Cause:**
@@ -148,18 +148,18 @@ Refactor template to extend base:
**How it Works:**
- Products have `marketplace_product.image_link` URLs
- Template uses fallback: `:src="image || '/static/shop/img/placeholder.svg'"`
- Template uses fallback: `:src="image || '/static/storefront/img/placeholder.svg'"`
- `@error` handler switches to placeholder when image fails to load
- Browsers won't render SVG content from `.jpg` files
**Solution Already Implemented:**
- Created proper `/static/shop/img/placeholder.svg`
- Created proper `/static/storefront/img/placeholder.svg`
- Added `@error` handlers to all image tags:
```html
<img
:src="product.image_link || '/static/shop/img/placeholder.svg'"
@error="$el.src = '/static/shop/img/placeholder.svg'"
:src="product.image_link || '/static/storefront/img/placeholder.svg'"
@error="$el.src = '/static/storefront/img/placeholder.svg'"
alt="Product image"
>
```
@@ -185,34 +185,34 @@ conn.commit()
**Symptoms:**
- Clicking product shows 404 error
- URL is: `/stores/orion/shop/shop/products/4` (double `/shop/`)
- URL is: `/storefront/orion/storefront/products/4` (double `/storefront/`)
- Server log shows route not found
**Root Cause:**
Duplicate `/shop` prefix in route definitions when router already has prefix.
Duplicate `/storefront` prefix in route definitions when router already has prefix.
**How it Works:**
```python
# Router is mounted with prefix
app.include_router(shop_pages.router, prefix="/shop")
app.include_router(storefront_pages.router, prefix="/storefront")
# Route decorator should NOT repeat the prefix
@router.get("/products/{id}") # ✅ Correct
@router.get("/shop/products/{id}") # ❌ Wrong - creates /shop/shop/products/{id}
@router.get("/storefront/products/{id}") # ❌ Wrong - creates /storefront/storefront/products/{id}
```
**Solution Already Implemented:**
All routes in `shop_pages.py` have been fixed to remove duplicate `/shop/` prefix.
All routes in `storefront_pages.py` have been fixed to remove duplicate `/storefront/` prefix.
### Missing `/shop/` in Links
### Missing `/storefront/` in Links
**Symptoms:**
- Links go to `/stores/orion/products` instead of `/stores/orion/shop/products`
- Links go to `/storefront/orion/products` instead of correct storefront URLs
- 404 errors on navigation
- Footer/header links broken
**Root Cause:**
Template links missing `/shop/` prefix after `{{ base_url }}`.
Template links missing `/storefront/` prefix after `{{ base_url }}`.
**Solution:**
```jinja2
@@ -220,15 +220,15 @@ Template links missing `/shop/` prefix after `{{ base_url }}`.
<a href="{{ base_url }}products">Products</a>
{# CORRECT #}
<a href="{{ base_url }}shop/products">Products</a>
<a href="{{ base_url }}storefront/products">Products</a>
```
**All Templates Fixed:**
-`shop/base.html` - Header, footer, navigation
-`shop/products.html` - Product links
-`shop/product.html` - Breadcrumbs, related products
-`shop/cart.html` - Continue shopping, checkout
-`shop/errors/404.html` - All fallback links
-`storefront/base.html` - Header, footer, navigation
-`storefront/products.html` - Product links
-`storefront/product.html` - Breadcrumbs, related products
-`storefront/cart.html` - Continue shopping, checkout
-`storefront/errors/404.html` - All fallback links
## Landing Page Issues
@@ -247,7 +247,7 @@ No landing page created for store.
if has_landing_page():
return render_landing_page()
else:
return redirect("/shop/") # Fallback
return redirect("/storefront/") # Fallback
```
**Solution:**
@@ -258,12 +258,12 @@ python scripts/create_landing_page.py
```
**Or Accept Redirect:**
The system auto-redirects to `/shop/` if no landing page exists. This is normal behavior.
The system auto-redirects to `/storefront/` if no landing page exists. This is normal behavior.
### Breadcrumb "Home" Points to Wrong Place
**Symptoms:**
- Clicking "Home" in breadcrumb goes to shop instead of landing page
- Clicking "Home" in breadcrumb goes to storefront instead of landing page
- Want "Home" to point to store root (/)
**Solution Already Implemented:**
@@ -271,12 +271,12 @@ The system auto-redirects to `/shop/` if no landing page exists. This is normal
{# Breadcrumb Home link points to store root #}
<a href="{{ base_url }}">Home</a>
{# Shop homepage link #}
<a href="{{ base_url }}shop/">Shop</a>
{# Storefront homepage link #}
<a href="{{ base_url }}storefront/">Storefront</a>
```
Navigation pattern:
- **Logo click** → `/shop/` (stays in shop for convenience)
- **Logo click** → `/storefront/` (stays in storefront for convenience)
- **Breadcrumb "Home"** → `/` (returns to landing page/root)
- **Header "Home" link** → `/` (returns to landing page/root)
@@ -317,7 +317,7 @@ return {
### Product ID is Undefined
**Symptoms:**
- API call: `/api/v1/shop/products/undefined`
- API call: `/api/v1/storefront/products/undefined`
- Console: `productId: undefined`
**Root Cause:**
@@ -346,12 +346,12 @@ Alpine.data('productDetail', () => ({
### Enable Verbose Logging
```javascript
// In shop-layout.js, the shopLog is already configured
// In storefront-layout.js, the storefrontLog is already configured
// Check browser console for:
🛒 [SHOP] Shop layout initializing...
🔍 [SHOP] Session ID: session_xxx
[SHOP] Adding to cart: {...}
[SHOP] Cart loaded: 3 items
🛒 [STOREFRONT] Storefront layout initializing...
🔍 [STOREFRONT] Session ID: session_xxx
[STOREFRONT] Adding to cart: {...}
[STOREFRONT] Cart loaded: 3 items
```
### Check Session ID
@@ -372,10 +372,10 @@ Alpine.$data(document.querySelector('[x-data]')).product
### Check API Responses
In browser Network tab, filter by "shop" and check:
- GET `/api/v1/shop/products` - Should return products array
- GET `/api/v1/shop/cart/{session_id}` - Should return cart items
- POST `/api/v1/shop/cart/{session_id}/items` - Should return success
In browser Network tab, filter by "storefront" and check:
- GET `/api/v1/storefront/products` - Should return products array
- GET `/api/v1/storefront/cart/{session_id}` - Should return cart items
- POST `/api/v1/storefront/cart/{session_id}/items` - Should return success
## Getting Help
@@ -383,7 +383,7 @@ In browser Network tab, filter by "shop" and check:
2. Check browser console for errors
3. Check server logs for API errors
4. Verify database has inventory entries
5. Ensure all templates extend `shop/base.html`
5. Ensure all templates extend `storefront/base.html`
6. Check that session ID is initialized
If still stuck, provide: