diff --git a/includes/assets/js/wishlist-view.js b/includes/assets/js/wishlist-view.js new file mode 100644 index 00000000..4231b028 --- /dev/null +++ b/includes/assets/js/wishlist-view.js @@ -0,0 +1,7 @@ +$(function() { + $('.ui.dropdown.wishlists').on('change', function() { + $('[name="wishlist_delete_id"]').val( + $('.ui.dropdown.wishlists').dropdown('get value') + ); + }); +}); diff --git a/includes/pages/wishlist-view.php b/includes/pages/wishlist-view.php index a8d32b4f..7e5cc3ee 100644 --- a/includes/pages/wishlist-view.php +++ b/includes/pages/wishlist-view.php @@ -20,6 +20,15 @@ if (isset($_GET['wishlist'])) { $wishlist = $_GET['wishlist']; $products = $user->getProducts($wishlist); } + +/** + * Delete wishlist + */ +if (isset($_POST['wishlist_delete_id'])) { + $database->query('DELETE FROM `wishlists` + WHERE id = ' . $_POST['wishlist_delete_id'] . ' + ;'); +} ?>
@@ -49,6 +58,15 @@ if (isset($_GET['wishlist'])) { Share + +
+ + + +