
Originally Posted by
jambazi
I cant find where zencart gets the products from the customers basket table and copies them to the order tables then deletes them from the customers basket... Hope it makes sense.
I just posted http://www.zen-cart.com/forum/showthread.php?p=1043378 which might be related to your questions. You might find some of the code references useful, at least.
The products aren't copied from teh basket table to the order table. The products are known about in the cart object (which reads from the TABLE_CUSTOMERS_BASKET table), and then the order object takes the cart products in checkout_confirmation/header_php.php:
Code:
$order = new order;
The order constructor, when passed no arguments, calls $this->cart() which causes it to initialise its list of products from the current shopping cart. This may include TABLE_CUSTOMERS_BASKET items or be entirely in-memory.
I think the deletion of basket contents is done in the order processing page, whose modules/pages/checkout_process/header_php.php code clears out the basket passing true, which causes it to delete from TABLE_CUSTOMERS_BASKET.
Code:
$_SESSION['cart']->reset(true);
Nick