Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

populate categories with products


quetzlcoatl

Recommended Posts

Hi,

 

I have set up all the categories and subcategories in my store. Now I need to populate those cats with products. The problem is, the products table I need to use contains thousands of products, which would be tedious and almost impossible to insert manually through the web-based admin.

 

The "products" and "products_description" tables have been populated, and the headings match those of the default oscommerce products and products_description tables, and I am not receiving any errors. The products are not showing up in the categories in the store, and the products to categories table is empty (i assume that's why they are not showing up).

 

Is there an "easy" way to populate the categories and subcategories with the products?

 

I have seen the easypopulate contribution, but can't use it since my products table file is originally a csv file, and that cannot be changed (it auto updates everyday through cron jobs from a distributor site).

 

Any help would be MUCH appreciated!!!!!! Thanks!

Link to comment
Share on other sites

Will it work with csv files (not necessarily saved from Excel)? The extension can't really be changed, unless there is a way to do it with a script than can be set to run automatically with cron jobs.

 

I downloaded easypopulate and the manual says:

 

"If you save from Excel as a "csv" file, it won't work."

 

Thanks for your help!

Link to comment
Share on other sites

You can use perl to filter the results from comma separated values (CSV) to tab-delimited values (which is what Easy Populate uses). However, if you are already able to get the products and products_descriptions tables populated, then you might find it easier to just parse the data to build the products_to_categories relationship.

 

How are you populating the tables? I.e. what commands?

 

Thanks,

Matt

Link to comment
Share on other sites

I just installed the easypopulate contribution, and created a table file with my products using the example that came with the contribution download.

 

When I try to upload the file using easypopulate from admin, nothing happens. No file shows up in the box.

 

Do you know why this may be happening?

 

 

You can use perl to filter the results from comma separated values (CSV) to tab-delimited values (which is what Easy Populate uses). However, if you are already able to get the products and products_descriptions tables populated, then you might find it easier to just parse the data to build the products_to_categories relationship.

 

How are you populating the tables? I.e. what commands?

 

We currently have the products set up in a database running separately from oscommerce. There is no shopping cart or cool features, just a site organized of products and categories. The structure is completely different from the oscommerce structure (which I did not build).

 

The current products table is being populated by commands in a PHP file, which basically empties the current table, then re-populates it from a csv file.

Link to comment
Share on other sites

When I try to upload the file using easypopulate from admin, nothing happens.  No file shows up in the box.

 

Do you know why this may be happening?

Generally this is a sign that your tempdir is set wrong. The fix that worked for me was removing /catalog from it. It is set in admin/easypopulate.php. Another thing to try is to upload the file to the temp directory with FTP and try to import the file from there.

 

If your CSV has product to category data, it shouldn't be hard to add the products_to_categories table to the update. It's a pretty simple table.

 

Hth,

Matt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...