Resolved
Hi Jason,
Just thought I better let you know the outcome of the support session with Ray, every issue was resolved in about half an hour, probably less.
1/
The solution to to the issue with the orders being overwritten if a second order is placed within half an hour from the first order by the same user whilst maintaining a logged in status, was not to try and store the users session variables in an array and try and recreate the session after destroying it completely.
It is to simply kill the eCart session for the OrderID at the bottom of the checkout_success page ...
<?php
unset($_SESSION["eCart1_OrderID"]);
$eCart1->ClearCart();
?>
2/
Inventory control was achieved simply by adding a couple of lines of code to the ipn page within the while loop from the PayPal form // WA eCart Get Form PaypalIPN.xml ...
mysql_select_db($database_dB_NAME, $dB_NAME);
$InvUpdate = "UPDATE products SET ProductStock = ProductStock -" . $ATC_Quantity. " WHERE ProductID = " . $ATC_ID;
mysql_query($InvUpdate,$dB_NAME);
3/
The e-mail was being sent from a recordset created on the ipn page, it should be sent from the checkout form responce from PayPal form, to the 'payer_email' as the record set would not be availible at the ipn post back action.
Only certain values are posted back and that is why you can not include all of the order information in the order confirmation e-mail.
I hope this helps anyone who is trying to achieve the same.