Thanks for making the updates, when I ran this months ago on my test server, I had to manually remove all the apostrophes in my database...took a long time, but eventually everything worked just fine.
What I am trying to do now though is, add the "Past / CUrrent / Pending Orders" which I think is very critical to converting over to ZenCart.
I am trying to figure this part out on my own, and this is what I have come up with so far.
The only problem I see is that, OsCommerce has an "orders_session_info" table and ZenCart does not, and ZenCart has an "orders_products" table and OsCommerce does not. But all the others seem to match up.
If someone with some expertise can look this over and make any corrections and let me know if it could be patched into the script that would be made of awesome!
Thanks
jeremy
PHP Code:$query_orders = "SELECT * FROM orders";
$orders = mysql_query($query_orders);
$i = 0;
echo 'exporting orders';
while ($export_record = mysql_fetch_assoc($orders)) {
$import_orders[$i]['orders'] = $export_record['orders'];
// $import_orders[$i]['orders_products'] = $export_record['orders_products'];
$import_orders[$i]['orders_products_attributes'] = $export_record['orders_products_attributes'];
$import_orders[$i]['orders_products_download'] = $export_record['orders_products_download'];
// $import_orders[$i]['orders_session_info'] = $export_record['orders_session_info'];
$import_orders[$i]['orders_status'] = $export_record['orders_status'];
$import_orders[$i]['orders_status_history'] = $export_record['orders_status_history'];
$import_orders[$i]['orders_total'] = $export_record['orders_total'];
$i++;
echo '.';
}
mysql_free_result($orders);
echo '<br><br>';
echo 'importing orders';
mysql_query("TRUNCATE `orders`");
while (list($i, ) = each($import_orders)) {
$insert_orders = "INSERT INTO zen_orders SET
zen_orders = '" . $import_orders[$i]['orders'] . "',
// zen_orders_products = '" . $import_orders[$i]['orders_products'] . "',
zen_orders_products_attributes = '" . $import_orders[$i][''orders_products_attributes'] . "',
zen_orders_products_download = '" . $import_orders[$i]['orders_products_download'] . "',
// zen_orders_sessions_info = '" . $import_orders[$i]['orders_session_info'] . "',
zen_orders_status = '" . $import_orders[$i]['orders_status'] . "',
zen_orders_status_history = '" . $import_orders[$i]['orders_status_history'] . "',
zen_orders_total = '" . $import_orders[$i]['orders_total'] . "',
";
$success = mysql_query($insert_orders);
if (!$success) { echo mysql_error(); exit;}
echo '.';
}
echo '<br><br>';


Reply With Quote

