wunschlisten button V1.0
This commit is contained in:
parent
843660c8c9
commit
59e2a6f46d
@ -33,6 +33,7 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
<h2>Produkt nicht gefunden</h2>
|
||||
<p>Bitte eine gueltige Produkt-ID mitgeben.</p>
|
||||
</section>
|
||||
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$stmt = $conn->prepare("
|
||||
@ -71,6 +72,11 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
$product = $result->fetch_assoc();
|
||||
?>
|
||||
|
||||
<?php
|
||||
$alreadyInWishlist = false;
|
||||
|
||||
|
||||
?>
|
||||
<div class="product-wrapper">
|
||||
<!-- LINKER BEREICH – BILD -->
|
||||
<div class="product-left">
|
||||
@ -79,6 +85,43 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
src="<?= isset($product['imagePath']) ? $product['imagePath'] : 'assets/images/placeholder.png' ?>"
|
||||
alt="<?= htmlspecialchars($product['model'] ?? 'Produktbild') ?>">
|
||||
</div>
|
||||
<?php if (isset($_SESSION['user_id'])): ?>
|
||||
|
||||
<?php if ($alreadyInWishlist): ?>
|
||||
|
||||
<div class="auth__actions">
|
||||
<input class="auth__submit" type="button"
|
||||
value="Bereits in Wunschliste"
|
||||
disabled>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="product_id" value="<?= (int)$productId ?>">
|
||||
<input type="hidden" name="add_wishlist" value="1">
|
||||
|
||||
<div class="auth__actions">
|
||||
<input class="auth__submit"
|
||||
type="submit"
|
||||
value="Zur Wunschliste hinzufügen">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div class="auth__actions">
|
||||
<a href="login.php">
|
||||
<input class="auth__submit" type="button"
|
||||
value="Zum Hinzufügen einloggen">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- RECHTER BEREICH – DETAILS -->
|
||||
@ -110,7 +153,7 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class ="shop-offers"
|
||||
|
||||
<?php $stmt->close(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user