Forums / General Questions / Which Function Copies Basket Items to Order Tables?

Which Function Copies Basket Items to Order Tables?

Views: 1,093

Results 1 to 4 of 4
29 Jun 2011, 8:26 PM
#1
jambazi avatar

jambazi

New Zenner

Join Date:
May 2007
Posts:
6
Plugin Contributions:
0

Which Function Copies Basket Items to Order Tables?

I need to modify the function that copies basket items to order. For instance when a customer orders, it gets added to the session then once they login its added to the session and customer basket table. When the customer completes the order, the order details are copied from the basket table to the orders table. I need to know which files to modify when the order is being created from the session. Thanks

29 Jun 2011, 8:47 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Which Function Copies Basket Items to Order Tables?

What exactly are you trying to modify? Why?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 Jun 2011, 10:15 PM
#3
jambazi avatar

jambazi

New Zenner

Join Date:
May 2007
Posts:
6
Plugin Contributions:
0

Re: Which Function Copies Basket Items to Order Tables?

I am working on a new shopping cart and I added a new table that references items in the cart. Its for a online business card design shopping cart. So a user can design their business card. The design tool I have developed allows users to create a nice graphic with layers and it uses GD library & JQuery - Similar to Vistaprint.com

I need to copy these layers for each product in the cart to the a new table orders_canvas_layers but 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.

30 Jun 2011, 6:09 AM
#4
neekfenwick avatar

neekfenwick

New Zenner

Join Date:
Feb 2009
Posts:
101
Plugin Contributions:
0

Re: Which Function Copies Basket Items to Order Tables?

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:

$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.

  $_SESSION['cart']->reset(true);

Nick