I have installed this contribution:
http://addons.oscommerce.com/info/5352
which adds a choice of a free gift from a drop down box in shopping cart.
It works well and is easy to install BUT when checking out, it add the free item info to a seprate table, orders_freegift...
I would like to add the free gift to the actual orders_products table so that it appears as a line item in the order. Any Idea how I might do this? This, I assume, is the code that adds the info to orders_freegift:
// Begin Free Gift Modification
$freegift_query = tep_db_query("SELECT products_description.products_name, products.products_model FROM products_description Inner Join products ON products.products_id = products_description.products_id WHERE products.products_id = '" . $cart->get_freegift() . "'");
$freegift = tep_db_fetch_array($freegift_query);
if ($cart->get_freegift() != 0) {
$sql_data_array = array('orders_id' => $insert_id,
'products_id' => $cart->get_freegift(),
'products_model' => $freegift['products_model'],
'products_name' => $freegift['products_name']);
} else {
$sql_data_array = array('orders_id' => $insert_id,
'products_id' => $cart->get_freegift(),
'products_model' => 'NA',
'products_name' => 'No Free Gift');
}
tep_db_perform('orders_freegift', $sql_data_array);
// End Free Gift Modification
But i am at a loss how to insert the same info into the orders_products. Any help would be greatly appreciated, thank you.














