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,
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/
- Initial release.
- Added check to see if uc_attribute module enabled.
- Added check to see if mapping to attribute option enabled 'field' is set (do nothing to option if not).
- 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).
- 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.
- Added enabled, required and ordering fields for attributes (not attribute options).