Import Not processing Categories Correctly

Feb 19, 2010 at 11:25 AM

Dave,

Trying to get the import to work with no luck.

I can import the products, but if I don't select Create Categories then the products end up with no categories.

If I select Create Categories, it doesn't match the products to the categories but creates new top level categories.

It's really pretty unusable as it is.

I downloaded the source, got it to build and had a look at it.

From what I can see, if you don't select Create categories, there's no code at all to link the categories in the import file to the existing categories.

Are you able to fix this in the very near future, or should I have a crack at it myself. I haven't done any development in VS2008 before, let alone DNN, but probably can work it out with some help. Main thing I can't see is how to run it in debug mode. Probably haven't set it up correctly. If I just run of my localhost, it runs fine. However if I run execute from VS2008 I get a directory listing of the NBStore folder.

JJ.

Coordinator
Feb 20, 2010 at 12:13 AM

hi JJ,

The categories should be working, I've used them on on a couple of our clients websites.  If you don;t check create categories then just categories won't be created, but if the category already exists then the products should be placed into it.  You should be aware that the categories are allocated via the category name, so you need to make the import file category name match exactly what the existing category name is.

What input file are you using a CSV or the XML import?

The xml should be just a direct import and is more reliable, but needs the correct format.  The CSV can be in any format, but you need to make sure all the settings for the CSV import file is setup, this can be very tricky to get right, and the documention is a bit poor (as always!!).  Have a look at these threads

http://nbstore.codeplex.com/Thread/View.aspx?ThreadId=70800

http://nbstore.codeplex.com/Thread/View.aspx?ThreadId=78851

http://nbstore.codeplex.com/Thread/View.aspx?ThreadId=81116

If you still can;t get it to work, let me know in a bit more detail what your doing?

On the Visual Studio compile I've created this http://nbstore.codeplex.com/wikipage?title=Setup%20NB_Store%20in%20Visual%20Studio&referringTitle=Devlopers%20Guide

This is for the next release of NB_Store and is not in codeplex yet, in which I've change the project sln file about a bit to make it easier...but basically the difference is I've removed the "localhost" project, because you don't need this.  I just had it there to move the dll's into the correct DNN/bin folder.  On the debug side, simple set the website running on localhost and then use the "Attach to Process" to link the code to Visual Studio.  Of course you need to compile NB_Store in debug mode in order to get your symbol table file.

Regards,

Dave.

Feb 20, 2010 at 6:07 AM

Dave,

This is my mapping:

<P>
  <NB_Store_ProductsInfo>
    <ProductID></ProductID>
    <PortalID>[PORTALID]</PortalID>
    <TaxCategoryID>-1</TaxCategoryID>
    <Featured>false</Featured>
    <Archived>false</Archived>
    <CreatedByUser>-1</CreatedByUser>
    <CreatedDate>2009-12-09T17:03:51.47</CreatedDate>
    <IsDeleted>false</IsDeleted>
    <ProductRef>[COL:2]</ProductRef>
    <Lang>[LANG]</Lang>
    <Summary>[COL:3]</Summary>
    <Description></Description>
    <Manufacturer>[COL:1]</Manufacturer>
    <ProductName>[COL:7]</ProductName>
    <XMLData></XMLData>
  </NB_Store_ProductsInfo>
  <M>
    <NB_Store_ModelInfo>
      <ModelID></ModelID>
      <ProductID></ProductID>
      <ListOrder>1</ListOrder>
      <UnitCost>[COL:4]</UnitCost>
      <Barcode />
      <ModelRef>[COL:2]</ModelRef>
      <Lang>[LANG]</Lang>
      <ModelName>[COL:7]</ModelName>
      <QtyRemaining>-1</QtyRemaining>
      <QtyTrans>0</QtyTrans>
      <QtyTransDate></QtyTransDate>
      <ProductName>[COL:3]</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.0000</PurchaseCost>
      <XMLData />
    </NB_Store_ModelInfo>
  </M>
  <I></I>
  <D></D>
  <C>
     <NB_Store_ProductCategoryInfo>
          <ProductID></ProductID>
          <CategoryID>[COL:5]</CategoryID>
          <ParentCategoryID>[COL:6]</ParentCategoryID>
      </NB_Store_ProductCategoryInfo>
  </C>
  <options></options>
</P>

 

This is a sample of my file:

Sunbelt Software,P411IEX1S00,Vipre Consumer Full Version Single User 1 Year,32.99,1 User,Vipre Consumer,Vipre Con 001U 1yr
Sunbelt Software,P411IEX1S02,Vipre Consumer Full Version Single User 2 Year,59.95,1 User,Vipre Consumer,Vipre Con 001U 2yr
Sunbelt Software,P411IEX1S03,Vipre Consumer Full Version Single User 3 Year,79.95,1 User,Vipre Consumer,Vipre Con 001U 3yr

If I import without creating categories, all the products import, but are linked to no categories.

If I import and create the categories, all the categories are created as top level categories. I then manually go through each one and link it to it's parent as a work around. So the category names definitely match.

It's somehow related to the parent categories.

This is my category mapping:

<NB_Store_CategoriesInfo>
  <CategoryID>[COL:5]</CategoryID>
  <PortalID>2</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:5]</CategoryName>
  <ParentName>[COL:6]</ParentName>
  <CategoryDesc></CategoryDesc>
  <Message></Message>
  <ProductCount>0</ProductCount>
  <ProductTemplate />
  <ListItemTemplate />
  <ListAltItemTemplate />
</NB_Store_CategoriesInfo>

 

Can't see what I'm missing. Probably something simple.

 

Coordinator
Feb 20, 2010 at 3:52 PM

Hi JJ,

I think your talking about the problem of categories not being created under parent categories,  this is because the parent categories don;t exist when the sub categories are imported.  The workaround is to place the parent categories in the import file before the import records in the category column...??? If that make sense?

There is also and issue with the invlaid product ref making the category fail to import...have a look at this issue and it shows you a workaround. http://nbstore.codeplex.com/WorkItem/View.aspx?WorkItemId=4409

Regards,

Dave.

Feb 20, 2010 at 10:03 PM

Dave,

I understand what you are saying but that's not what's happening here.

If I import and don't have the create categories ticked, so I'm not trying to import categories, none of the items get associated with the categories.

The categories have the correct name, because they were created via the import (and then moved under the correct parents).

If I do the import and say create categories, Items that are to be placed under a top level category work. However items that are under a child category end up with a new parent category of the same name. Somehow the process of identifying the category by name when it's a child doesn't return a category id, so a new one gets created.

JJ.

 

Feb 20, 2010 at 10:35 PM

Dave,

Got it to work,

1. Import as new products (I'd deleted them all first)

2. Enable Create Categories (even though all the categories exist)!!!!

4. Create dummy products at the start of the file for each of the parent categories.

JJ

 

Coordinator
Feb 21, 2010 at 11:32 AM

Hi JJ,

Great that you've got it working, I think the problem is the same issue.  The work around is to create the parent categories before.....I think it's to do with the import file building up the full path of the category (i.e. "parent>sub category"), but if the parent isn;t in the import file it can't assume that the category is the right one, even if the name is the same.

Hopefully we'll get a better fix in the future.

Regards,

Dave.

Feb 21, 2010 at 8:18 PM

Dave,

No worries.

I wouldn't mind getting involved in the project. What would I need to do? ie Which source control are you using?

There are a couple of things I would like to see in the product, and it's better to do it as part of the project rather than make my own mods and then have to keep updating them.

Getting the import module to work better would be one of them.

JJ.

Coordinator
Feb 21, 2010 at 9:18 PM

Hi JJ,

Great, I'm always more than happy to include other devlopers work into NB_Store.  If you contact me through codeplex and I'll be able to get in contact and organise any efforts you want to make, so we don;t get overlap and to ensure any changes can be fitted into NB_Store without issues.

Regards,

Dave.

(P.S. I'm in th UK at the moment, I'll be back in the office tomorrow, but it'll probably be wednesday before I've caught up with work and be able to reply)