I am building an online store for a client with OpenCart. I needed to import data from an existing osCommerce store so I purchased an osCommerce to OpenCart script.
The script was a great help but it needed a lot of changes to work nicely and fail gracefully. I emailed the changes back to the script author. At my request he has added a credit link to the script page.
Below is a summary of the changes I made:
- Add mysql_query() query string to error messages to help track down problem query.
- Use one strtr() call instead of multiple calls to str_replace() when creating $seo urls.
- Do not add the product_id (or category_id or manufacturer_id) to the SEO url unless there is a url clash.
- Count the number of products/categories/manufacturers copied to OpenCart and display at the end.
- Don’t die() when a mysql_query() fails – store the error and display it later (for product/category/manufacturer copying).
- Put “Back” button inside ‘p’ tags.
- Added ‘manufacturer_to_store’ table to the TRUNCATE list.
- Reformat list of tables to truncate to make it easier to read.
- Added setting at top of script to disable copying of image files (my osCommerce and OpenCart databases were on different servers).