3 replies [Last post]
sgriffin's picture
Offline
Joined: 12/30/2008
Juice: 40

Is it not available for this version yet? I can't find any associated documentation.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6841
Re: Where's the importer

The importer that came with Ubercart 1.x has been deprecated. I didn't think it was very good, and I didn't want to maintain it anymore. It was hard to use, and never quite fit the needs of anyone, including myself.

Since it's going away, I should probably recommend some alternatives. I've been writing my own SQL queries to build CSV files that I can then import with phpMyAdmin. Doing it that way is really easy when you need to move data from a Drupal site to a Drupal site because you don't have to worry about joining or aliases. However, it works best only for populating a new site.

The node import module sounds like a good idea, but it might still need some help getting to Drupal 6. Since that's easier to use than custom SQL, I'd like to see it be the official Ubercart solution to importing products.

drdmmr's picture
Offline
Joined: 01/13/2009
Juice: 16
Re: Re: Where's the importer

I am using D6.9 and UC2.0-beta4

This is a workaround. I've successfully imported a CSV file of products and got images to show up in my catalog.

This is my procedure:

Copy all images to sites/default/files
import data from CSV file, using the node_import (images and taxonomy* fail as expected).
*I just leave this out of the import to avoid the slew of errors.

Using a 'Drupal bootstrapped' PHP script, I convert my CSV file into an associative array (by model). I read the uc_products table, 1 row at a time, (db_fetch_object) gathering the model, nid and vid for each record.
Using the model, I get the image field from my CSV data.
After determining the mime and filesize, I insert all this (along with the path) into the files table and fetch the corresponding fid.
With all this data, I update the content_field_image_cache table:
nid = $nid
vid = $vid
field_image_cache_list = 0
field_image_cache_fid = $fid
field_image_cache_data = 'a:0:{}';

and call drupal_flush_all_caches();

When I refresh my Drupal site, I see my catalog with all my images!

I'm fairly new to this stuff and I'm sure there's a much more "Drupal" approach than this hack (which I will work on forthwith). I needed this functionality, my site appears to work fine, and I wanted to share my success with other folks who need this as well.

I'm now working on getting the taxonomy importing as well.

subscribing,

Doug

qrios's picture
Offline
Cool profile pic award.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 554
Re: Re: Where's the importer

Subscribing, a decent importer is much needed IYAM.

"Since it's going away"
Maybe it should be removed as a feature from the "What is Ubercart?" page then?