fix(storefront): add missing placeholder image asset and onerror fallback
getMainImage() referenced /assets/images/placeholder.svg as the no-image fallback, but src/assets/images/ never existed - any item with zero photos rendered a browser broken-image icon instead of a placeholder. Added the asset. Also added an (error) handler (onImageError) on every dynamic <img> that renders a user/admin-supplied URL (product card, cart line item, cart payment QR code, product gallery main + thumbnails) so a 404'd/broken image URL swaps to the shared placeholder instead of shipping broken.
This commit is contained in:
8
src/assets/images/placeholder.svg
Normal file
8
src/assets/images/placeholder.svg
Normal file
@@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300" role="img" aria-label="No image available">
|
||||
<rect width="300" height="300" fill="#f1f1f1"/>
|
||||
<g fill="none" stroke="#c7c7c7" stroke-width="8" stroke-linejoin="round" stroke-linecap="round">
|
||||
<rect x="40" y="60" width="220" height="180" rx="10"/>
|
||||
<circle cx="100" cy="115" r="18"/>
|
||||
<path d="M40 210 L120 140 L170 185 L210 150 L260 200 L260 240 L40 240 Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 446 B |
Reference in New Issue
Block a user