2 replies [Last post]
bsenftner's picture
Offline
Joined: 07/09/2009
Juice: 107
Was this information Helpful?

Hi All,

As a portion of the development for a Ubercart book covering creating dynamic digital products (on the fly created custom products realized as file downloads) I am almost finished with a D6 UC2 bulk importer. This far, I have working bulk imports of:

  • bulk import a directory hierarchy into the "files" table; this updates existing files that have moved as well as adds new files
  • both export and import, where an export can be loaded into Excel, modified, written back out and imported to realize any changes
  • new or existing product nodes of a specific type; each product type uses a separate import routine for support of custom fields
  • implemented through Services.module, functionality can be accessed remotely
  • import/export supports any taxonomy terms associated with products
  • import/export supports custom sku strings for each option of a product with attributes & options
  • a single image-cache image for each product, with title and alt strings supported

I've been developing this with a working set of about 400 different products, of two (soon 5) different product types. One product type has 4 options, and the other product type has 3 options, giving me something like 1280 different downloadable product files.

I have two features left to complete this Import/Export module: bulk import/export of the downloadable product files themselves, and bulk import/export of the sell_price modifications associated with each product option.

Considering that product features are not stored in the node itself, I'm thinking that supporting them will be an additional routine after the initial import. As far as I can tell, I see no usable API routine that supports working with product features, so I'll need to hit the database directly. Does this sound correct for how they are structured in the database?

  1. uc_files is a DB table auto-populated with all the files located inside the "files_path" field of File Download Settings on the admin/store/products/files page
  2. uc_product_features is a "higher level" DB table that tracks all product features (both file downloads and role assignments),
  3. uc_file_products is a DB table that tracks all downloadable product files, providing the linkage between uc_product_features and uc_files

My question, after this long prelude, is: are there any other tables I need to modify to support bulk import of file download product features?
Anyone know of previous work in this area I could reference? Seems like supporting attributes is a challenge that stopped most work in this area, before getting to product features...

TutusForToddlers's picture
Offline
Joined: 11/17/2007
Juice: 158
bsenftner, Have you made any

bsenftner,
Have you made any progress on this module? It would be great.

Thanks,
Claire
Tutus for Toddlers sells Tutus using UberCart for e-commerce with Drupal.

bsenftner's picture
Offline
Joined: 07/09/2009
Juice: 107
I created breadcrumbs for others to follow

Hi Claire,

As that work developed, I ended up making the decision to control complexity of the module by keeping it private. The issue being, many of the products I am working with have attribute sets that I wanted to error check against, and other private to each product unique data & links that should have error checking applied at import. Designing a system that generalized the import so any product or node could have this unique data, while also supplying validation data for error checking, complicated the module to a degree that I could see my intended users hesitant and probably uncomfortable learning how to use it.

So I put the error checking specific to this store right in the bulk import, making the end users import task a simple procedure.

But knowing that my work would be valuable to others, I gave a fairly comprehensive talk at the DrupalCampLA. You can download my slides and view the talk from here:
http://www.missingubercartmanual.com/Creating-Custom-Ubercart-Import-Exp...

The slides contain working code that you can use to create your own bulk importer. Given the code in my slides, most moderately experienced drupal developers should be able to create a working bulk import/export system in a bit over a week - with most of that time figuring out the unique data for your specific products so they can plug in those boundary conditions in the code I provide.

I know it's not as good as an official module. In my video I explain at the beginning why such as module is difficult. (Pretty much what I say above, plus maintenance would be significant.)

(and FWIW, I've also stopped development on that Ubercart book. With Drupal 7 out, D6UC2 still has a lot of life in it, but interest is in D7 Commerce, and I'm yet to crack that. Too little time...)

(Off topic: I just visited your site. Adorable. Smiling )