PDA

View Full Version : Wishlist 2.0



michael_s
10-14-2008, 11:01 AM
when user delete products from wishlist and than rebot browser, wishlist show that products cause load are from cookie,

to fix it do:


find:



/************************************************** *****************
****************** DELETE PRODUCT FROM WISHLIST ********************
************************************************** *****************/

if (isset($HTTP_POST_VARS['add_wishprod'])) {
if(isset($HTTP_POST_VARS['delete_prod'])) {
foreach ($HTTP_POST_VARS['add_wishprod'] as $value) {
$wishList->remove($value);
}

}
}






and change for :


/************************************************** *****************
****************** DELETE PRODUCT FROM WISHLIST ********************
************************************************** *****************/

if (isset($HTTP_POST_VARS['add_wishprod'])) {
if(isset($HTTP_POST_VARS['delete_prod'])) {
foreach ($HTTP_POST_VARS['add_wishprod'] as $value) {
$wishList->remove($value);
}

// create cookie
$days = 30;
$time = time() + (3600 * 24 * $days);
$cook_id = serialize($wishList->wishID);
tep_setcookie('wish', $cook_id , $time);


}
}




More... (http://addons.oscommerce.com/info/1682)