qwertyjjj Posted September 28, 2009 Posted September 28, 2009 Hi I have some code in checkout_success.php that adds a row into one of my specific database tables. What I would like to do is at the same time, create a record in the orders status history with some comments that the user can automatically read when they go to their order history. I saw in checkout_process.php the following: tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); I presume that I cannot just add that code to checkout_success as it won't know what the array is so do I have to perform a separate insert statement?
♥ecartz Posted October 1, 2009 Posted October 1, 2009 The $sql_data_array variable is set immediately before that statement in checkout_process.php: $sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => $order->info['order_status'], 'date_added' => 'now()', 'customer_notified' => $customer_notification, 'comments' => $order->info['comments']); tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); You would need to change $insert_id to something that holds the order ID. You would need to set the status appropriately. The now() would stay the same. The $customer_notification would probably change to '0'. You can put mostly arbitrary text in the comments section. You could also do the insert manually if you want, but this method provides good discipline in forcing you to define all the necessary fields. Always back up before making changes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.