diff --git a/productpage.php b/productpage.php index ef67f64..db88e94 100644 --- a/productpage.php +++ b/productpage.php @@ -106,36 +106,36 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_review']) && i } ?> - + // FALL 2: Von der Wunschliste entfernen (NEU) + elseif (isset($_POST['remove_wishlist']) && $alreadyInWishlist) { + $stmtDel = mysqli_prepare($conn, "DELETE FROM userFavorites WHERE productID = ? AND userID = ?"); + if ($stmtDel) { + mysqli_stmt_bind_param($stmtDel, 'ii', $productId, $_SESSION['user_id']); + mysqli_stmt_execute($stmtDel); + mysqli_stmt_close($stmtDel); + + // Status aktualisieren, damit gleich wieder der "Hinzufügen"-Button erscheint + $alreadyInWishlist = false; + } + } +} +?> -
- -
+ +
+ + + +
+ +
+
+ +
@@ -182,7 +190,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_review']) && i
+ +