Import Products Issue

Jan 18, 2010 at 1:09 AM

I just installed the latest version of NB_store 2.00.07

I seem to have an import isssue for CSV files.  I am using the default productimportcsv template without any changes.  I did add a delimiter of ;

Here is my one line CSV file which fails:

Breakfast;a1r53;;Grand Slammie Express;Includes Scrambled Eggs with Cheese, Two Bacon Strips, Two Sausage and Ham, Pancakes or French Toast, Juice, and Coffee;;;8.75;;;;

 I'm following the template example of:

[COL:1],[COL:2],[COL:3],[COL:4],[COL:5],[COL:6],[COL:7],[COL:8],[COL:9],[COL:10]
CategoryName,ProductRef,Manufacturer,ProductName,Summary,XMLData(Custom Product Field),Weight,UnitCost,{Unused},ImageName

When I run the import I get:

Imported: 1 Products
Imported: 1 Categories



Product Ref: "a1r53" failed to import.

I tried different values for productref, and still get the error.  Am I missing something fundemental here?

-Thanks
Jason

Jan 18, 2010 at 1:40 AM
Edited Jan 18, 2010 at 1:50 AM

Been through that he** for a few days... I'll try to pitch in.

The added delimiter should not be a problem, as long as you add it for the complete set of records...
First of all, my problems seem do dimmish when adding the following settings...

fielddelimeter.importmapping = ;
fieldescapedqualifier.importmapping = two doublequotes ""
fieldqualifier.importmapping = single doublequote "
rowdelimeter.importmapping = [empty]

that is [empty] equals nothing..

Have you added those?

If so, could you post both the
categoryCSV.ImportMapping and  productCSV.ImportMapping you are using.



Here is my files that works perfectly...

categoryCSV.ImportMapping

<NB_Store_CategoriesInfo>
  <CategoryID></CategoryID>
  <PortalID>[PORTALID]</PortalID>
  <Archived>false</Archived>
  <CreatedByUser>-1</CreatedByUser>
  <CreatedDate>2009-12-09T17:03:51.47</CreatedDate>
  <ParentCategoryID></ParentCategoryID>
  <ListOrder>1</ListOrder>
  <Lang>[LANG]</Lang>
  <CategoryName>[COL:3]</CategoryName>
  <ParentName>[COL:2]</ParentName>
  <CategoryDesc></CategoryDesc>
  <Message></Message>
  <ProductCount>0</ProductCount>
  <ProductTemplate />
  <ListItemTemplate />
  <ListAltItemTemplate />
</NB_Store_CategoriesInfo>
productCSV.ImportMapping
<P>
  <NB_Store_ProductsInfo>
    <ProductID></ProductID>
    <PortalID>[PORTALID]</PortalID>
    <TaxCategoryID>-1</TaxCategoryID>
    <Featured>false</Featured>
    <Archived>false</Archived>
    <CreatedByUser>-1</CreatedByUser>
    <CreatedDate>2009-09-10T17:03:51.47</CreatedDate>
    <IsDeleted>false</IsDeleted>
    <ProductRef>[COL:1]</ProductRef>
    <Lang>[LANG]</Lang>
    <Summary></Summary>
    <Description></Description>
    <Manufacturer></Manufacturer>
    <ProductName>[COL:4]</ProductName>
    <XMLData></XMLData>
  </NB_Store_ProductsInfo>
  <M>
    <NB_Store_ModelInfo>
      <ModelID></ModelID>
      <ProductID></ProductID>
      <ListOrder>1</ListOrder>
      <UnitCost>[COL:5]</UnitCost>
      <Barcode />
      <ModelRef>[COL:1]</ModelRef>
      <Lang>[LANG]</Lang>
      <ModelName>[COL:4]</ModelName>
      <QtyRemaining>-1</QtyRemaining>
      <QtyTrans>0</QtyTrans>
      <QtyTransDate></QtyTransDate>
      <ProductName>[COL:4]</ProductName>
      <PortalID>[PORTALID]</PortalID>
      <Weight>0.00</Weight>
      <Height>0.00</Height>
      <Length>0.00</Length>
      <Width>0.00</Width>
      <Deleted>false</Deleted>
      <QtyStockSet>0</QtyStockSet>
      <DealerCost>0.0000</DealerCost>
      <PurchaseCost>0.000</PurchaseCost>
      <XMLData />
    </NB_Store_ModelInfo>
  </M>
  <I>
  <NB_Store_ProductImageInfo>
    <ImageID></ImageID>
    <ProductID></ProductID>
    <ImagePath>h:\wwwroot\www\Portals\4\productimages\[COL:6]</ImagePath>
    <ListOrder>1</ListOrder>
    <Hidden>false</Hidden>
    <Lang>[LANG]</Lang>
    <ImageDesc />
    <ImageURL>/Portals/4/productimages/[COL:6]</ImageURL>
  </NB_Store_ProductImageInfo>
  </I>
  <D></D>
  <C>
    <NB_Store_ProductCategoryInfo>
      <ProductID></ProductID>
      <CategoryID>[COL:3]</CategoryID>
      <ParentCategoryID>[COL:2]</ParentCategoryID>
    </NB_Store_ProductCategoryInfo>
  </C>
  <options></options>
</P>

A bit of CSV file to try and see

"tmpDummy";"";"Equip";"Dummy product";"0.00";"noimg.jpg";"";"";"";""
"500-257";"Equip";"Amme";"Product one, cat one";"49.5";"3_500-8005.JPG";"noimg.jpg";"noimg.jpg";"noimg.jpg";""
"500-140";"Equip";"Trolley";"Product two, cat two";"499";"noimg.jpg";"noimg.jpg";"noimg.jpg";"noimg.jpg";""
"500-028";"Equip";"Trolley";"Product three, cat two";"1399";"6B-1-08.jpg";"noimg.jpg";"noimg.jpg";"noimg.jpg";""

- Ron

Jan 18, 2010 at 1:55 AM

This configuration will first create a Equip category, with a dummy product in it, for use as a main category for the next three products.

I have had success with this recently importing approx 1500 products at once.

Hope this helps.

-Ron

Jan 18, 2010 at 6:52 AM
Edited Jan 18, 2010 at 7:05 AM

Thanks Ron, your example works.  I need to play around a bit.  I'm still not sure what is wrong with the templates which arrive with the installation?

 

Jan 18, 2010 at 8:12 AM

On the import of csv files, the validation of the unitcost is done....so make sure your unitcost is a valid format otherwise it'll fail that record.

 

Jan 18, 2010 at 2:00 PM

Try putting 0 for weight just prior to the price 8.75

Breakfast;a1r53;;Grand Slammie Express;Includes Scrambled Eggs with Cheese, Two Bacon Strips, Two Sausage and Ham, Pancakes or French Toast, Juice, and Coffee;;0;8.75;;;;

I had the same problem this morning.
Hope it helps
Thomas

Apr 1, 2011 at 11:08 AM
ronhof wrote:

Been through that he** for a few days... I'll try to pitch in.

The added delimiter should not be a problem, as long as you add it for the complete set of records...
First of all, my problems seem do dimmish when adding the following settings...

fielddelimeter.importmapping = ;
fieldescapedqualifier.importmapping = two doublequotes ""
fieldqualifier.importmapping = single doublequote "
rowdelimeter.importmapping = [empty]

that is [empty] equals nothing..

Have you added those?

If so, could you post both the
categoryCSV.ImportMapping and  productCSV.ImportMapping you are using.



Here is my files that works perfectly...

categoryCSV.ImportMapping

<NB_Store_CategoriesInfo>
  <CategoryID></CategoryID>
  <PortalID>[PORTALID]</PortalID>
  <Archived>false</Archived>
  <CreatedByUser>-1</CreatedByUser>
  <CreatedDate>2009-12-09T17:03:51.47</CreatedDate>
  <ParentCategoryID></ParentCategoryID>
  <ListOrder>1</ListOrder>
  <Lang>[LANG]</Lang>
  <CategoryName>[COL:3]</CategoryName>
  <ParentName>[COL:2]</ParentName>
  <CategoryDesc></CategoryDesc>
  <Message></Message>
  <ProductCount>0</ProductCount>
  <ProductTemplate />
  <ListItemTemplate />
  <ListAltItemTemplate />
</NB_Store_CategoriesInfo>
productCSV.ImportMapping
<P>
  <NB_Store_ProductsInfo>
    <ProductID></ProductID>
    <PortalID>[PORTALID]</PortalID>
    <TaxCategoryID>-1</TaxCategoryID>
    <Featured>false</Featured>
    <Archived>false</Archived>
    <CreatedByUser>-1</CreatedByUser>
    <CreatedDate>2009-09-10T17:03:51.47</CreatedDate>
    <IsDeleted>false</IsDeleted>
    <ProductRef>[COL:1]</ProductRef>
    <Lang>[LANG]</Lang>
    <Summary></Summary>
    <Description></Description>
    <Manufacturer></Manufacturer>
    <ProductName>[COL:4]</ProductName>
    <XMLData></XMLData>
  </NB_Store_ProductsInfo>
  <M>
    <NB_Store_ModelInfo>
      <ModelID></ModelID>
      <ProductID></ProductID>
      <ListOrder>1</ListOrder>
      <UnitCost>[COL:5]</UnitCost>
      <Barcode />
      <ModelRef>[COL:1]</ModelRef>
      <Lang>[LANG]</Lang>
      <ModelName>[COL:4]</ModelName>
      <QtyRemaining>-1</QtyRemaining>
      <QtyTrans>0</QtyTrans>
      <QtyTransDate></QtyTransDate>
      <ProductName>[COL:4]</ProductName>
      <PortalID>[PORTALID]</PortalID>
      <Weight>0.00</Weight>
      <Height>0.00</Height>
      <Length>0.00</Length>
      <Width>0.00</Width>
      <Deleted>false</Deleted>
      <QtyStockSet>0</QtyStockSet>
      <DealerCost>0.0000</DealerCost>
      <PurchaseCost>0.000</PurchaseCost>
      <XMLData />
    </NB_Store_ModelInfo>
  </M>
  <I>
  <NB_Store_ProductImageInfo>
    <ImageID></ImageID>
    <ProductID></ProductID>
    <ImagePath>h:\wwwroot\www\Portals\4\productimages\[COL:6]</ImagePath>
    <ListOrder>1</ListOrder>
    <Hidden>false</Hidden>
    <Lang>[LANG]</Lang>
    <ImageDesc />
    <ImageURL>/Portals/4/productimages/[COL:6]</ImageURL>
  </NB_Store_ProductImageInfo>
  </I>
  <D></D>
  <C>
    <NB_Store_ProductCategoryInfo>
      <ProductID></ProductID>
      <CategoryID>[COL:3]</CategoryID>
      <ParentCategoryID>[COL:2]</ParentCategoryID>
    </NB_Store_ProductCategoryInfo>
  </C>
  <options></options>
</P>

A bit of CSV file to try and see

"tmpDummy";"";"Equip";"Dummy product";"0.00";"noimg.jpg";"";"";"";""
"500-257";"Equip";"Amme";"Product one, cat one";"49.5";"3_500-8005.JPG";"noimg.jpg";"noimg.jpg";"noimg.jpg";""
"500-140";"Equip";"Trolley";"Product two, cat two";"499";"noimg.jpg";"noimg.jpg";"noimg.jpg";"noimg.jpg";""
"500-028";"Equip";"Trolley";"Product three, cat two";"1399";"6B-1-08.jpg";"noimg.jpg";"noimg.jpg";"noimg.jpg";""

- Ron

How to modify the code above, to use " Update Existing Products:" function, in order to certain data for product to remain unchainged.

 For example, my products have a picture but do not have price. I want to use

"tmpDummy";"";"Equip";"Dummy product";"0.00";"noimg.jpg";"";"";"";""
"500-257";"Equip";"Amme";"Product one, cat one";"49.5";"3_500-8005.JPG";"noimg.jpg";"noimg.jpg";"noimg.jpg";""
"500-140";"Equip";"Trolley";"Product two, cat two";"499";"noimg.jpg";"noimg.jpg";"noimg.jpg";"noimg.jpg";""
"500-028";"Equip";"Trolley";"Product three, cat two";"1399";"6B-1-08.jpg";"noimg.jpg";"noimg.jpg";"noimg.jpg";""

Without image token [COL:6], Because products already have photos

 

Hristo

Apr 1, 2011 at 11:58 AM

Hi Hristo,

This is going to update you product, it's onluy designed as an import function.  What you need to use it the model update function (BO>Utilites>Import), it's only available in v2.2.2 and unfortunatly I've not had chance to document it yet.

I works on the same idea as the product import but uses the "modelCSV.ImportMapping" setting.  If then node is left empty then no update is done....

    <NB_Store_ModelInfo>
<ModelID></ModelID>
<ProductID></ProductID>
<ListOrder></ListOrder>
<UnitCost>[COL:2]</UnitCost>
<Barcode />
<ModelRef>[COL:1]</ModelRef>
<Lang></Lang>
<ModelName></ModelName>
<QtyRemaining></QtyRemaining>
<QtyTrans></QtyTrans>
<QtyTransDate></QtyTransDate>
<ProductName></ProductName>
<PortalID>[PORTALID]</PortalID>
<Weight></Weight>
<Height></Height>
<Length></Length>
<Width></Width>
<Deleted></Deleted>
<QtyStockSet></QtyStockSet>
<DealerCost></DealerCost>
<PurchaseCost></PurchaseCost>
<XMLData />
</NB_Store_ModelInfo>


Not sure if the above structure is correct...just copied and pasted it from above...but it gives you the idea. I'll try and get some documentation done on it.

Regards,
Dave.
Apr 3, 2011 at 6:30 PM

where is "modelCSV.ImportMapping"?

And for categoryCSV.ImportMapping Is this correct

<NB_Store_CategoriesInfo>
  <CategoryID></CategoryID>
  <PortalID>[PORTALID]</PortalID>
  <Archived>false</Archived>
  <CreatedByUser></CreatedByUser>
  <CreatedDate>2009-12-09T17:03:51.47</CreatedDate>
  <ParentCategoryID></ParentCategoryID>
  <ListOrder></ListOrder>
  <Lang>[LANG]</Lang>
  <CategoryName></CategoryName>
  <ParentName></ParentName>
  <CategoryDesc></CategoryDesc>
  <Message></Message>
  <ProductCount></ProductCount>
  <ProductTemplate />
  <ListItemTemplate />
  <ListAltItemTemplate />
</NB_Store_CategoriesInfo>

 

Previous version worked without giving this error : A critical error has occurred.
Object reference not set to an instance of an object.

Apr 4, 2011 at 8:15 AM

Hi Hotris,

The settings doesn;t exist, because I've not documented anything on it yet. You'll have to create it.

Witht he error?...can you have a look at the DNN event log and get a full error message, so we can have a better idea of what's going wrong.

Regards,

Dave.

Apr 4, 2011 at 5:24 PM

log file is:

AssemblyVersion: 5.6.2
PortalID: 0
PortalName: My Website
UserID: 1
UserName: host
ActiveTabID: 63
ActiveTabName: store
RawURL: /store/tabid/63/ctl/AdminBackup/mid/383/spg/res/Default.aspx?SkinSrc=%2fDesktopModules%2fNB_Store%2fSkins%2fDark%2fDark
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://hristopenev.co.cc/store/tabid/63/ctl/AdminBackup/mid/383/spg/res/Default.aspx?SkinSrc=%2fDesktopModules%2fNB_Store%2fSkins%2fDark%2fDark
UserAgent: Mozilla/5.0 (Windows NT 6.1; rv:2.0) Gecko/20100101 Firefox/4.0
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 89acfcda-138b-4bd4-9f62-596655caa206
InnerException: Object reference not set to an instance of an object.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: NEvoWeb.Modules.NB_Store.AdminBackup.cmdDoImport_Click
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at NEvoWeb.Modules.NB_Store.AdminBackup.cmdDoImport_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

 

Please tell what the problem is? Аlways gives this error.

Apr 6, 2011 at 7:37 AM

Hi

Can you pass me on an example of the file your trying to import, so I can test it here?

Regards,

Dave.

Apr 6, 2011 at 4:34 PM

This error occurs on a clean install DNN v.05.06.02 and NB_Store_02.02.02.
Just
click BO-Utilities-Import  -Import, without any other settings and without having file to import.
I know this is not correct, but it also appears after the correct settings.


Apr 7, 2011 at 8:34 AM

HI,

Um...Just tried it on my dev machine and got no error?.....I'll create a fresh install later today and see if I can re-create the problem, I'll let you know.

Regards.

Dave.

Apr 7, 2011 at 10:56 AM

Hi hotris,

Sorry this is my fault, I've missed including the new ascx file for the module import.  I've done this now and loaded up v2.2.2a onto codeplex.

Give that a go and let me know what happens.

Regards,

Dave

Apr 7, 2011 at 10:58 AM

Oh...also be aware that modeulimport is a quick addition for a client, and is yet to be fully tested.

Apr 9, 2011 at 6:01 PM

Excellent work. Thanks!

Apr 25, 2011 at 8:59 PM
Edited Apr 25, 2011 at 9:04 PM

I have a problem with the Import Function.

It seems to only import the product info, but not the model info, or image info.

Am i suppose to create my own model and image importMapping files?

Here is an image i screen capped of the product details: http://www.jfulgar.com/nbStore.jpg (case-sensitive)

as you can see, the bottom part (starting at Ref, Name, Extra and so on...) did not get filled in, and also doesnt even have boxes that i can fill manually.

 

This is done on a Fresh Install of DNN 05.06.02 & with Fresh Install of NB_STORE 02.02.03

importing from CSV File with "import as new products" & "Create Categoires" radio boxes checked.

after import, this is what i get. (x is variable)

Imported: X Products
Imported: X Categories

Product Ref: "XXXXXXX" failed to import.

However, each product does gets imported, and each category gets imported, but no model, image, or category info is attached to each imported product.

Here are my settings...

_______________________________

productCSV.importMapping (modelled after product export xml file):

<P>
    <NB_Store_ProductsInfo>
        <ProductID>1</ProductID>
        <PortalID>0</PortalID>
        <TaxCategoryID>-1</TaxCategoryID>
        <Featured>false</Featured>
        <Archived>false</Archived>
        <CreatedByUser>1</CreatedByUser>
        <CreatedDate>2011-04-23T12:27:44.817</CreatedDate>
        <IsDeleted>false</IsDeleted>
        <ProductRef>[COL:2]</ProductRef>
        <Lang>en-US</Lang>
        <Summary>[COL:4]</Summary>
        <Description>[COL:5]</Description>
        <Manufacturer>[COL:9]</Manufacturer>
        <ProductName>[COL:3]</ProductName>
        <XMLData />
        <ModifiedDate>2011-04-23T12:30:18.02</ModifiedDate>
        <SEOName>[COL:2]</SEOName>
        <TagWords />
        <IsHidden>false</IsHidden>
    </NB_Store_ProductsInfo>
    <M>
        <NB_Store_ModelInfo>
            <ModelID>1</ModelID>
            <ProductID>1</ProductID>
            <ListOrder>1</ListOrder>
            <UnitCost>[COL:7]</UnitCost>
            <Barcode />
            <ModelRef>[COL:2]</ModelRef>
            <Lang>en-US</Lang>
            <ModelName>[COL:3]</ModelName>
            <QtyRemaining>-1</QtyRemaining>
            <QtyTrans>0</QtyTrans>
            <QtyTransDate>2011-04-23T12:27:44.86</QtyTransDate>
            <ProductName>[COL:3]</ProductName>
            <PortalID>0</PortalID>
            <Weight>[COL:6]</Weight>
            <Height>0.00</Height>
            <Length>0.00</Length>
            <Width>0.00</Width>
            <Deleted>false</Deleted>
            <QtyStockSet>0</QtyStockSet>
            <DealerCost>[COL:8]</DealerCost>
            <PurchaseCost>0.0000</PurchaseCost>
            <XMLData />
            <Extra />
            <DealerOnly>false</DealerOnly>
            <Allow>0</Allow>
        </NB_Store_ModelInfo>
    </M>
    <I>
        <NB_Store_ProductImageInfo>
            <ImageID>1</ImageID>
            <ProductID>1</ProductID>
            <ImagePath>\\boswinfs04\home\users\web\b2678\whl.hilinegift\hlusa\Portals\0\productimages\[COL:10]</ImagePath>
            <ListOrder>1</ListOrder>
            <Hidden>false</Hidden>
            <Lang>en-US</Lang>
            <ImageDesc />
            <ImageURL>/hlusa/Portals/0/productimages/[COL:10]</ImageURL>
        </NB_Store_ProductImageInfo>
    </I>
    <D></D>
    <C>
        <NB_Store_ProductCategoryInfo>
            <ProductID>1</ProductID>
            <CategoryID>1</CategoryID>
        </NB_Store_ProductCategoryInfo>
    </C>
    <R></R>
    <options></options>
</P>

_______________________________

categoryCSV.importMapping (modelled after product export xml file):

<NB_Store_CategoriesInfo>
    <CategoryID>0</CategoryID>
    <PortalID>0</PortalID>
    <Archived>false</Archived>
    <Hide>false</Hide>
    <CreatedByUser>1</CreatedByUser>
    <CreatedDate>2011-04-23T12:24:36.133</CreatedDate>
    <ParentCategoryID>0</ParentCategoryID>
    <ListOrder>1</ListOrder>
    <Lang>en-US</Lang>
    <CategoryName>[COL:1]</CategoryName>
    <ParentName />
    <CategoryDesc />
    <Message />
    <ProductCount />
    <ProductTemplate />
    <ListItemTemplate />
    <ListAltItemTemplate />
    <ImageURL />
</NB_Store_CategoriesInfo>

_______________________________

CSV CODE from screen capped image product

FLORAL LIGHT - ACRYLIC SPRAY,59200-B,59200-B,FLORAL ACRYLIC SPRAY-BROWN-6pc min,"35"" Floral Spray Brown 6 pc min  <ul><li>Floral Spray Brown 6 pc min <li>10 leaves each with its own berry <li>Minimum purchase 6 <li>Color: Brown <li>Great for display in bouquet of flowers or vase <li>Easy to mix in with floral arrangements </li></ul> ",0,2.5,0,6,59200-B.jpg

 

 

____

 

any idea what's going on???

 

Thanks

-Jeff

Mar 2, 2015 at 12:41 PM
Thanks to ron and davi Sir,
                         After a 3 days continuous efforts to import products today I understand what exactly the csv file is but still I have problem. After changing the productcsv and  categorycsv like above I am getting the error like
System.NullReferenceException: Object reference not set to an instance of an object. at NEvoWeb.Modules.NB_Store.ImportCSV.buildCSVCategoryXML(PortalSettings PS, String[] CSVlines, String FieldDelimeter, String FieldQualifier, String FieldEscapedQualifier) at NEvoWeb.Modules.NB_Store.ImportCSV.ImportCSVProducts(PortalSettings PS, String ImportFile, Boolean UpdateExistingProductsFlg, Boolean CreateCategoriesFlg, String RowDelimeter, String FieldDelimeter, String FieldQualifier, String FieldEscapedQualifier)

please tell me which file I need to change is left. its urgent

please help