Webshop/public/shop/shop_lkw.html
vextv 7a4f3dd62e Merge remote-tracking branch 'origin/develop' into Bestellung
# Conflicts:
#	public/login/login.html
#	public/registrieren/registrieren.html
#	public/shop/shop_lkw.html
#	public/shop/shop_motorrad.html
#	public/shop/shop_oldtimer.html
#	public/shop/shop_sportwagen.html
2025-04-27 20:17:21 +02:00

69 lines
2.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shop - LKW's</title>
<link rel="stylesheet" href="/Styles/styles-main.css">
<link href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css" rel="stylesheet">
<script src="/header_footer"></script>
</head>
<body>
<div class="wrapper">
<!-- Header -->
<div id="header-placeholder"></div>
<!-- Hauptinhalt -->
<main>
<section style="padding: 0px 30px; text-align: left;">
<h1>Unsere LKW Produkte</h1>
</section>
<section class="card-grid" id="products_lkw">
<!-- Dynamische Produkte (filtern nach Motorrad) -->
</section>
</main>
<!-- Fußzeiele -->
<div id="footer"></div>
</div>
<script>
fetch('/api/products/lkw')
.then(res => res.json())
.then(products => {
const container = document.getElementById('products_lkw');
container.innerHTML = ''; // sicherheitshalber leeren
products.forEach(product => {
const card = document.createElement('div');
card.classList.add('card');
card.innerHTML = `
<img src="${product.image_url}" alt="${product.name}">
<h3>${product.name}</h3>
<p>Preis: ${product.price}€</p>
<p>${product.description}</p>
<p>Artikel Nr: ${product.id}</p>
<button class="add-to-cart" data-id="${product.id}">Zum Warenkorb hinzufügen</button>
`;
container.appendChild(card);
});
})
.catch(err => {
console.error('Fehler beim Laden der LKW_Produkte:', err);
const container = document.getElementById('products_lkw');
container.innerHTML =
`<div class="error-message">
<h3>Fehler beim Laden der Produkte</h3>
<p>Es gab ein Problem beim Abrufen der Produktdaten.<br>
Wir arbeiten bereits daran bitte versuchen Sie es später erneut.</p>
</div> `;
});
</script>
<!-- Fußzeiele -->
<div id="footer"></div>
</body>
</html>