Downloads
This is an add-on for node_import that allows importing of products via CSV (or TSV) files. It's based on this code but extended to add validation and support for attributes.
Columns from the file can be mapped to fields of the products (eg cost, sell price, weight), and standard node data (eg vocab terms).
Yes/no or on/off field types (eg shippable or attribute option enabled) must be of one of
y, yes, t, true, 1,
or
n, no, f, false, 0
To import attribute data the attributes and options must already exist in the system. To enable an attribute for a product there is a field called "<attribute name>: enabled"; there are also "<attribute name>: required" and "<attribute name>: ordering" fields for each attribute. It's then possible to map fields from the CSV file to the attributes option fields (enabled, cost, price, weight, ordering). It will modify only the values of the options selected/mapped to, and only if the attribute is enabled for the product. The 'enabled' column fields must contain either y, yes, t, true or 1 for the option to be enabled or n, no, f, false, 0 for the attribute or option to be removed from the product. If no column is mapped to enabled then the option data will be ignored.
Products can be updated with this patch to node_import.
NOTE: previewing of the attribute data currently doesn't work (it just shows current attribute data if updating a product). If anyone wants to figure out a nice way to make this work, be my guest. 
To install, first install node_import, then copy uc_product.inc into node_import/supported/
Change log:
Beta 1
- Initial release.
Beta 2
- Added check to see if uc_attribute module enabled.
Beta 3
- Added check to see if mapping to attribute option enabled 'field' is set (do nothing to option if not).
Beta 4
- Added all remaining standard product fields (weight units, length, width, height, dimension units, package quantity, default quantity, ordering, shippable). All are validated.
- Fixed body/description field (wrong node field referenced).
- Changed boolean value validation (for shippable and attribute enable fields), now accepts 1, y, yes, t, true, n, no, f, false (not case sensitive, values yes, true, no, false are translatable).
Beta 5
- Fixed validation for default add to cart quantity, package quantity and list position (http://drupal.org/node/272323#comment-899240). These values are now allowed to be blank or have no column assigned (in which case they will be set to 1, 1 and 0 respectively).
- Added check for required values Name, SKU and Sell price.
Beta 6
- Added enabled, required and ordering fields for attributes (not attribute options).
Development
| Preview | Attachment | Size |
|---|---|---|
| uc_product.inc-beta6.tar.gz | 3.47 KB |



