Save store summary in database behavior does not insert into DB, saves OrderID of 1 to the Session anyways.
Hello,
I have just upgraded to ecart 6. I have a handful of static products which I added with Ecart 5 that all add to cart just fine. I re-created the checkout pages with Ecart 6. When I proceed through the checkout process, I do all the paypal stuff, and when I am redirected back to my site, it pulls up the checkout_success.php page with Order Number of 1. However, the new record is not inserted into the database, and the database has 6 rows in it, last row id of 7 (left from Ecart 5). It seems to be setting the $_SESSION['CartID'] variable to 1 even though it doesn't insert an ID of 1 (no ID of 1 exists in the db, it was deleted).
There were a few attempts when ecart actually updated an existing row in the database with blank values and showed the ID of the row it updated in the checkout_success.php page next to Order Number. Assuming it was an old Session ID, I manually unset / destroyed the session vars, it started to just show an Order ID of 1, and upon dumping the $_SESSION vars to the screen, I can see the $_SESSION['order_id'] is being set every time I try to check out. Shouldn't it throw an error if it cannot insert to the db?
After looking through the pp_confirm.php, I find this line which is more than likely the culprit:
if (isset($_SESSION[$ConditionalQuery->SaveAs])) $ConditionalQuery->addFilter("OrderID", "=", "d", $_SESSION[$ConditionalQuery->SaveAs]);
Do I even need this line?? I really don't want people to update their orders. But after I comment it, the save summary in Database behavior disappears from the server behaviors panel. And I'm afraid that will make any future edits a PITA.
Also, am I supposed to manually clear the CartID session var once I'm done with it? If somebody wants to order another product separately, I don't want them to overwrite their previous order(s) in the DB.
should I also mention I am using a Dynamic MySQLi connection to switch between localhost and remote host.
Thanks