tags:

views:

224

answers:

2

I need to add several hundred products to an osCommerce (ugh, I know, it wasn't my choice) but osCommerce doesn't have a built in method for this (or at least I couldn't find it), does anyone know where some (even half decent) documentation on HOW osCommerce stores products ('cause it certainly is not in any logical manner) can be found? Or possibly some free addon/software that will do it?

A: 

I used phpMyAdmin to insert items from the previous store.

First I had to do some converting to utf-8 with iconv, which you might not need, then I used these sql statements:

insert into products_description (
SELECT art_id as products_id, 4 as language_id, naziv as products_name, CONCAT(dolgOpis, '<br /><br />', kratekOpis) as products_description, NULL AS products_url, 0 AS products_viewed from artikel_utf;
);

4 is for english in my installation - check table languages. You must insert every product once for every language you have with a corresponding number for language_id

then you need to insert every product you inserted into a category. I put them all in the base category:

insert into `products_to_categories` (SELECT products_id, 0 FROM products);

I'm not sure if I also filled the manufacturers and products_description tables. If you find out you have to do it, you should also set manufacturer_id in products table for each product. Also the products_description table needs an entry for every language you use

Spikolynn
+1  A: 

Have used something of the likes of Easy Populate but found the attributes part of it not meeting a project's needs. Hacked up some code to allow for the fix up according the client specs.

If you're importing a batch raw with no attributes, and just want to drop them into the base category of the store, you'll only need to 3 tables to work with:

products

Deals with the prices and the images

products_description

Deals with the name as well as the description and setting of manufacturers.

products_to_categories

Sorts out which of the store's categories the products will be placed under. Far as working this table goes, 0 should be the base folder category of the store.

random