Zen Cart Logo
Forums / Managing Customers and Orders / capture additional information during checkout

capture additional information during checkout

Views: 850

Results 1 to 4 of 4
14 Jun 2013, 11:49 AM
#1
peteratdd avatar

peteratdd

New Zenner

Join Date:
May 2009
Posts:
8
Plugin Contributions:
0

capture additional information during checkout

Zen cart 1.5.1

Can you help?

Here's what I am trying to do...

I need to record the product item's cost price after checkout so I can create a single sales export which includes the final price and the cost price. The cost price is to be recorded in the PRODUCTS table in a new field (cost), each time a product is added, along with the usual info.

I have also created a new field in table ORDERS_PRODUCTS called my_cost_price for the purpose of recording the cost price for a sold product, but how do I get that field populated when an order occurs?

I think this is might be done via includes/classes/order.php and even assuming that is correct I am not at all clear how to call up the data from the table PRODUCTS for the products_model that has been sold - so that it is inserted into that table.

Is it possible - if so how? Any possible issues about doing this?

Thanks.

14 Jun 2013, 12:50 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: capture additional information during checkout

Why record it after checkout??

Just enter it when setting the product up

14 Jun 2013, 1:18 PM
#3
peteratdd avatar

peteratdd

New Zenner

Join Date:
May 2009
Posts:
8
Plugin Contributions:
0

Re: capture additional information during checkout

kobra:

Why record it after checkout??

Just enter it when setting the product up

We do enter it when setting up and updating the product - and the result is placed in the PRODUCTS table. We also update to the 'current average cost' when updating stock levels. Why? We sell at low margins and need easy way to keep track.

We wanted to pass orders to our backoffice systems automatically and can export info OK from the ORDERS_PRODUCTS table via the 'Export_shipping_information' mod. It would help us to be able to export the cost price too - hence the request. It seemed the easiest way would be to record the cost price with the sale price and get that written to the ORDERS_PRODUCTS table.

Certainly, and just for testing, I have manually adjusted the ORDERS_PRODUCTS table with the cost price and the sales export works a treat. Now need to get it to happen for real as sales occur.

Thanks for your comment.

14 Jun 2013, 3:06 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: capture additional information during checkout

By default orders.php generates the order confirmation email and also sends extra copies to the admin address if enabled
One would have to add the "cost" data to ONLY the admin email interrupting the auto function of sending the standard confirmation to the admin

You might get a clue looking at the alterations for "Dual pricing wholesale" plugin