Jump to content

I can't delete my wishlist in my account


Recommended Posts

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 by system_error86 (see edit history)
Link to comment
Share on other sites

  • 7 months later...

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

×
×
  • Create New...