The following is posted for the benefit of all. If you have questions, or if interested in my website services, please create a free user account so you can contact me through my web form (sorry, for spam purposes, I do not allow my contact form to be used unless you are an authenticated user on this site).

Best regards,

Tom Isabelle

Creating Products In Ubercart

Products can be created as a "Product" node in Drupal. This can be done one-by-one through Administer > Content Management > Create Content > Product.

Suppose you have several products? Dozens, hundreds, or thousands. There is a way that this can be done in a much easier way. Here is how I have done it . . .

1. Install and enable the following Drupal modules:

2. Next, make sure you have a Spreadsheet program installed on your local computer such as Microsoft Excel or OpenOffice.org Calc (this opensource software is FREE to download and use, and available for Linux, Mac, or Windows operating systems).

3. With your Spreadsheet software, create a simple .csv file (character set must be "Unicode (UTF-8)"). The first rows will be the headers, the following rows will be the actual data for the products you are importing. I suggest starting simple with just one row of data that you can test until you understand the process. Only certain characters are allowed based on the type of data that the column is calling for once you get to the actual import. You may have other fields that are not shown below. Add them to your .csv file as needed.

If you are creating products with several categories that are in a hierarchy structure, you must first manually create the taxonomy terms, then adjust your vocabulary setting so that "Tags" are unselected, "Multiple select" is selected, and "Required" is unselected. Then in the "Products" column of you .csv file, use the names of your final end category. For example, if your taxonomy hierarchy looks like "Beverages > Soda > Coca Cola > Ramblin' Root Beer", then the only thing you would type in the column for a product to go under the category of "Ramblin' Root Beer", is just that . . . "Ramblin' Root Beer" (for those of you born after 1990, this was a real type of soda made by Coca Cola).

Do not use the following characters in any field: , "

Header (* required fields) Allowed Characters
Name* uppercase/lowercase alpha, numeric
Image (exact file name of image)
Products (exact Taxonomy vocabulary name for the item)
Input format "filtered html" or "full html"
Description uppercase/lowercase alpha, numeric, html
SKU* uppercase/lowercase alpha, numeric
List price numeric (format 0.00)
Cost numeric (format 0.00)
Sell Price* numeric (format 0.00)
Shippable "1" or "2" only (1 = yes, 2 = no)
Weight numeric
Weight unit "Pounds", "Kilograms", "Ounces", or "Grams"
Dimensions unit "Inches", "Feet", "Centimeters", or "Millimeters"
Length numeric
Width numeric
Height numeric
Package quantity numeric (format 0.00)
Default cart quantity numeric
List position numeric
Authored by (name of user)
Authored on (format 2000-01-01 12:00:00 +0000)
Sticky at top of lists "1" or "2" only (1 = yes, 2 = no)
Promoted to front page "1" or "2" only (1 = yes, 2 = no)
Published "1" or "2" only (1 = yes, 2 = no)
Comment settings "Disabled", "Read only", or "Read/Write"
URL path settings uppercase/lowercase alpha, numeric

For more details on what each field requires, you may want to view the Product creation page on your site (http:// yoursite .com/node/add/product).

4. If you have products with images, you must upload any images to your Drupal folder: /sites/default/files/

5. Now follow the simple 8 step process for Node Import (http:// yoursite .com/admin/content/node_import/add). Easy as that! Unless you get stuck on Node Import's step 3, like I did. This was my error message:

- - -
Fatal error: Call to undefined function uc_product_node_is_product() in /home/MYSITE/www/www/sites/all/modules/node_import/supported/ubercart/uc_product.inc on line 15
- - -

This was how I fixed it (thanks to the assistance of my very helpful hosting company):

"The fix for that problem is available on the following page: http://drupal.org/node/641852

You should edit the file /www/www/sites/all/modules/node_import/supported/ubercart/uc_product.inc and change the line containing the function call to uc_product_node_is_product(). The function call should be uc_product_is_product() instead."

After the above fix, it went through seamlessly for me.

6. You are done! View your newly imported product node(s) at (http:// yoursite .com/admin/content/node/overview).

7. If you ever plan on updating your products SAVE the .csv file you used and BACK IT UP!
 

Interested in categorizing products in Ubercart?