I tried to populate my catalog by importing an excel spreadsheet and I ran into issues. I solved them by performing the following steps:
Create a bogus product in your catalog.
Then Export your product to an Excel Spreadsheet to give you a base template for importing (Catalog, Products, Manage Products, Export to Excel).
Copy and paste the appropriate columns from the spreadsheet you want to import to the spreadsheet you just exported.
Import the spreadsheet (Catelog, Products, Manage Products, Import From Excel).
OK, Here is where the fun part begins. The import kept bombing out. To debug it, I ran it locally.
nopCommerce logs the errors (System, Log) so I opened up the line of code that was bombing out.
Turns out that it didn't like the creation date that I copied as a string. It was looking for a double number.
The code is in the Libraries/nopServices/ExportImport/ImportManager.cs file.
I commented out the CreateOnUtc date line and replace it with DateTime.now
//DateTime createdOnUtc = DateTime.FromOADate(Convert.ToDouble(dr["CreatedOnUtc"]));
DateTime createdOnUtc = System.DateTime.Now;
I run the import again and now it bombs out on the 4th row. I check the error log file again. Turns out that I have weights and measurements for some records and not for others.
In the same ImportManager.cs file, I change the code for the weight, length, width, height to:
// LJD 11/08/2011
decimal weight = 0.00M;
if (!String.IsNullOrEmpty(dr["Weight"].ToString()))
{
weight = Convert.ToDecimal(dr["Weight"]);
}
decimal length = 0.00M;
if (!String.IsNullOrEmpty(dr["Length"].ToString()))
{
length = Convert.ToDecimal(dr["Length"]);
}
decimal width = 0.00M;
if (!String.IsNullOrEmpty(dr["Width"].ToString()))
{
width = Convert.ToDecimal(dr["Width"]);
}
decimal height = 0.00M;
if (!String.IsNullOrEmpty(dr["Height"].ToString()))
{
height = Convert.ToDecimal(dr["Height"]);
}
//decimal length = Convert.ToDecimal(dr["Length"]);
//decimal width = Convert.ToDecimal(dr["Width"]);
// decimal height = Convert.ToDecimal(dr["Height"]);
Ta Dah! 2 weeks of catalog setup done in 2 hours.