clear shopping cart content on body unload or browser exit
Posted: Mon Nov 03, 2008 11:38 pm
hi all
i am looking for a function that clears the contents of the shopping cart on closing the browser or browser exit and displays an confirm alert before removing the contents.
i have a script that clear contents on clicking the clear cart button but i need to have the same option on closing the browser or browser exit.
this is my script
vineet
i am looking for a function that clears the contents of the shopping cart on closing the browser or browser exit and displays an confirm alert before removing the contents.
i have a script that clear contents on clicking the clear cart button but i need to have the same option on closing the browser or browser exit.
this is my script
Code: Select all
if(isset($_REQUEST['clear_cart_x']))
{
$product_id=$row['product_id'];
$image=$row['image'];
$product_name=$row['product_name'];
$price=$row['price'];
$shipping_cost=$row['shipping_cost'];
$quantity=$row['quantity'];
$total_cost=$row['total_cost'];
$qry="delete from cart_table where unique_id='$unique_id'";
mysql_query($qry);
}