Clears Cart (sort of)
Thanks for the tip but I must be doing something wrong.
I am using the checkout process that was created with the eCart 5 wizard. There is no payment gateway, this is just a TakeOut order process for a customer to collect and pay at the shop.
So I am putting the code you suggest in the checkout_success.php page which is basically the 'Thank you for your order' message.
From your post I assume I had to add a session which I did with a name ClearCartSession.
This is what I added before the doctype:
//WA eCart Include
<?php require_once('../Connections/testDB.php'); ?>
if (!session_id()) session_start();
$_SESSION["ClearCartSession"] = "";
I am using a template so I put the unset part after the body but before the closing html tag:
On testing the process, the order gets added to the database, the email is sent and the cart appears empty. So far so good.
If I create another order, everything processes as expected but the previous order is replaced in the database with the new order instead of being added as a new order.
Any idea what I am doing wrong?