fix: resolve product detail page data access and add placeholder image

Issues fixed:
- Product ID was undefined - Alpine.js couldn't access data-product-id from nested div
- Missing placeholder image caused 404 errors

Changes:
- Pass product_id and vendor.id through window globals instead of dataset
- Initialize productId and vendorId directly from window variables
- Add placeholder.jpg SVG for products without images
- Add debug logging to track initialization

The product detail page now correctly loads products and handles missing images.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-23 06:26:51 +01:00
parent 1df4f12e92
commit e94b3f9dca
2 changed files with 15 additions and 8 deletions

View File

@@ -0,0 +1,6 @@
<svg width="400" height="400" xmlns="http://www.w3.org/2000/svg">
<rect width="400" height="400" fill="#f3f4f6"/>
<text x="50%" y="50%" font-family="Arial, sans-serif" font-size="20" fill="#9ca3af" text-anchor="middle" dominant-baseline="middle">
No Image Available
</text>
</svg>

After

Width:  |  Height:  |  Size: 291 B