Duplicate OrderreferenceIds - Ecart 5
Hello,
I use the following code on checkout succes page to reset things. When user buys other stuff after this, the new orders get the same orderreferenceid in the database as the other already finished order which i reset on the success page?
I need other sessions alive (logged in users) BTW but in the example i destroy everything (and that seems to work since users get thrown out) but still i keep getting the same orderreferenceid as the completed order from previous session...
When the user uses the same windo or new tab it gets the orderreferenceid of the first finished order as orderreferenceid... When you go back the cart is empty and all so it is a new order in the database but like i said the new order has the same orderreferenceid as the completed order(s)...
Also the part after session_destroy does not seem to execute..
//TOp of page
<?php
if (!session_id()) session_start();
if(!isset($_SESSION["MyCart_OrderID"])) {
$_SESSION["MyCart_OrderID"] = "";
}
?>
// Bottom page
<?php
$MyCart->ClearCart();
unset($_SESSION['MyCart_OrderID']);
session_destroy();
if ($MyCart->IsEmpty()) {
$MyCart->redirStr = "store_cart.php";
$MyCart->cartAction = "RedirectIfEmpty";
}
?>
Any help would be great
WKR