Importing data into Ubercart

Posts: 4
Joined: 07/30/2008

Well I have data in the form of a CSV file. I have the import CSV module and it will upload my products, however the node ID does not increase with each iteration of product. I am thinking it may be that the XML file does not sort this correctly. Can anyone give me an example of the structure of a Product. I have the following fields
SKU
Brand
Type/Category
Supplier
Description
Price
Size
Quantity

Are there any other fields I would need, and if so what. I will format my CSV to the XML format once I have a template, it's just understanding the way the template is created for a product with multiple sizes but the same SKU

Many Thanks
Jay

Posts: 143
Joined: 04/05/2008
Bug Finder

did you solve this?

Posts: 143
Joined: 04/05/2008
Bug Finder

Well, i'm going to do a minor-hijack on this thread to avoid duplication and ask the forum regulars whats the most current way of importing new data into Ubercart.

Last time i did this (May 2008) was using node_import ( http://drupal.org/project/node_import ) along with "uc_product.inc" posted at http://www.ubercart.org/comment/7642/node-import-add .

At the time, with Ubercart RC4, it worked well. But iirc there was no way of importing pictures back then!

So now that we have Ubercart 1.5, i would like to ask:

Did anything change in this regards?

Is there need for an updated "uc_product.inc" or can we still use the old one?

What's the best way to import a new list of products along with photos?

Posts: 116
Joined: 04/23/2008

Follow these links:

http://www.ubercart.org/contrib/5221

http://www.ubercart.org/forum/support/4561/product_import#comment-20188

It has information you need to know to load products using drupal's node_import & images too.

It is not XML based.

Posts: 143
Joined: 04/05/2008
Bug Finder

Thanks but there's one thing i didnt understand.

There's something there talking about a patch?

How many patches are needed in these case and where do i get them?

Posts: 116
Joined: 04/23/2008

It depends on what you are trying to do.

- start with drupal's node_import module
http://drupal.org/project/node_import

- then it needs ubercart's uc_product.inc to enable product imports.
see here for various versions: http://www.ubercart.org/contrib/5221

- if you also want to import images, then you need the cck patch for node_import
see here: http://drupal.org/node/143471

Posts: 143
Joined: 04/05/2008
Bug Finder

zeezhao wrote:
Follow these links:

http://www.ubercart.org/contrib/5221

http://www.ubercart.org/forum/support/4561/product_import#comment-20188

It has information you need to know to load products using drupal's node_import & images too.

It is not XML based.

Zeezhao, do you mind posting details on the patching ?

I want to import a list of new products into my Ubercart catalogue along with their photos.

But I dont fully get your post (second link).. what needs to be patched?

Posts: 116
Joined: 04/23/2008

If you read further down the trail on the 2nd link, there is the posting of the patched file I used...

Posts: 143
Joined: 04/05/2008
Bug Finder

I've been doing some tests (drupal 5.10, ubercart 1.5, node_import 1.6, uc_product.inc beta6 and patched content.inc from http://drupal.org/node/143471#comment-915491) and this does work.

I noticed the following:

- There needs to be a column for shipable status - this seems to be required, so i just created a new column with "y" on all rows (y means yes).

- There needs to be a unique image filename for each product. I had some products with no photo, sharing a "no_photo_available.gif" and this caused problems (like i imported 18 products but there was 54 of them in the end).

- It doesnt seem to be problematic to leave the image field empty (in case you have no photo for the product).

And last but not least, i'm having problems with special characters. My category terms that use the letter "ç" (c cedilla) are completely ignored on the import process.

Posts: 2357
Joined: 08/07/2007
AdministratoreLiTe!

I don't know exactly how node_import handles this, but the default Drupal behavior is to use UTF-8 character encoding everywhere. The database tables store text that way, the default themes output text that way, so I think you should check that your import file is in UTF-8.

I hope what's happening is that node_import is reading your file and sees the category name that isn't valid UTF-8, so it doesn't know what you meant and skips it as the safest option. IE in particular is vulnerable to malformed multi-byte strings, so it's behaving responsibly, at least.

Posts: 143
Joined: 04/05/2008
Bug Finder

Lyle wrote:
I don't know exactly how node_import handles this, but the default Drupal behavior is to use UTF-8 character encoding everywhere. The database tables store text that way, the default themes output text that way, so I think you should check that your import file is in UTF-8.

I hope what's happening is that node_import is reading your file and sees the category name that isn't valid UTF-8, so it doesn't know what you meant and skips it as the safest option. IE in particular is vulnerable to malformed multi-byte strings, so it's behaving responsibly, at least.

Hi, after reading your post i converted my csv file from ANSI to UTF-8 using notepad2 and yes, the import is now pulling up the terms correctly.

So that was it. Thanks!

Posts: 143
Joined: 04/05/2008
Bug Finder

It's been one month and i already forgot.. Where do we put all the photos, before starting the import process?

"Files" or "Files_temp" ?

Update: It's the Files folder.