Sorry, do I need to change the session_id() reference to be the name of the session or should it just be left as session_id()?
Where I'm confused on this is that the Add to Cart behaviour has this for people who are new customers:
$ATC_itemID = $_POST["eCartSMC_1_ID_Add"];
The itemID, in the above instance, is being populated by this:
<input type="hidden" name="eCartSMC_1_ID_Add" value="<?php echo($rsEDITFORM->getColumnVal("SMCformID")); ?>">
However, for returning customers it's this:
$ATC_itemID = $_SESSION["eCartSMC_OrderID"];
Which is populated by the session value eCartSMC_OrderID.
We have two different tables with the following primary key fields...
1) Forms (SMCformID)
2) Orders (SMCorderID)
Customers complete the form - it inserts a new record in the Forms table with a unique SMCformID and a session value of NEWformID - and when they press the "Finish" button on the last page of the form, it creates a new record in the Orders table with a unique SMCorderID and a status ID indicating that payment is outstanding.
The INSERT behaviour for the Orders table creates the following session value:
$InsertQuery->saveInSession("eCartSMC_OrderID");
Once that's done, the customer is presented with the Add to Cart button. Should the Add to Cart behaviour actually have this for itemID?:
$ATC_itemID = $_SESSION["eCartSMC_OrderID"];
...and for returning customers:
$ATC_itemID = "". $rsEDITFORM->getColumnVal("SMCorderID") ."";
This is all on the assumption that $ATC_itemID is the unique ID that's passed to PayPal, however I'm not clear on that. SMCformID is the only product that should be able to be added to the cart, so I'm wondering if, actually, it's the NEWformID session that should be the $ATC_itemID?
Hoping that you can help me un-muddle this.
Thank you.
NJ