system_error86 Posted April 30, 2014 Share Posted April 30, 2014 (edited) Hello I try to find out how can delete my saved wishlist! I tried to change the code in the WishList.php public function delete() { Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'wishlist`'); Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'wishlist_email` WHERE `id_wishlist` = '.(int)($this->id)); Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'wishlist_product` WHERE `id_wishlist` = '.(int)($this->id)); if (isset($this->context->cookie->id_wishlist)) unset($this->context->cookie->id_wishlist); return (parent::delete()); } and in the ajax-wishlist.js this function WishlistDelete(id, id_wishlist, msg) { var res = confirm(msg); if (res == false) return (false); if (typeof mywishlist_url == 'undefined') return (false); $.ajax({ type: 'GET', async: true, url: mywishlist_url + '&rand=' + new Date().getTime(), cache: false, data: 'deleted&id_wishlist=' + id_wishlist, success: function(data) { $('#' + id).fadeOut('slow'); } }); } to function WishlistDelete(id, id_wishlist, msg) { var res = confirm(msg); if (res == false) return (false); if (typeof mywishlist_url == 'undefined') return (false); $.ajax({ type: 'GET', async: true, url: baseDir + 'modules/blockwishlist/WishList.php', cache: false, data: 'deleted&id_wishlist=' + id_wishlist, success: function(data) { $('#' + id).fadeOut('slow'); } }); } but nothing! My wish list steal in the database! any suggestions??? please Edited April 30, 2014 by system_error86 (see edit history) Link to comment Share on other sites More sharing options...
ferguz Posted December 1, 2014 Share Posted December 1, 2014 You try function WishlistDelete(id, id_wishlist, msg) { var res = confirm(msg); if (res == false) return (false); $.ajax({ type: 'GET', async: true, url: baseDir + 'modules/blockwishlist/WishList.php', cache: false, data: 'deleted&id_wishlist=' + id_wishlist, success: function(data) { $('#' + id).fadeOut('slow'); } }); } Link to comment Share on other sites More sharing options...
Recommended Posts