Hi Ray,
I have been trying to implement this feature but for some reason is not working for me. Nothing is being deleted.
This is what I'm doing.
1) From the view-cart.php I have a "Remove" link next to each item loaded in the cart. This link looks like:
<a href="remove.php?cart=<?php echo session_id(); ?>&id=<?php echo $eCart1->DisplayInfo("ID"); ?>">Remove</a>
2) Then, the link points to a remove.php page that grabs the info and tries to execute the delete function you provided to Oscar. The page looks like this:
<?php
$cart = $_GET['cart'];
$id = $_GET['id'];
function DeleteByID($cart,$id) {
for ($n=0; $n<sizeof($cart->Items); $n++) {
if ($cart->Items[$n]) {
if ($cart->Items[$n]->ID == $id) {
$cart->Items[$index] = null;
$cart->ReIndexContent();
$cart->ResetAll();
$cart->SaveCart();
}
}
}
}
?>
For some unknown reason, nothing happens. No error messages either. Any clue by looking at the above code?
I'm adding the required pages in the remove.php as wel:
<?php require_once("../WA_eCart/eCart1_PHP.php"); ?>
<?php $eCart1->GetContent(); ?>
Thanks much for your time!