Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 6 of 6

Thread: Problem with Category-Import

  1. #1
    MiBfinity is offline Member
    Join Date
    Jul 2008
    Posts
    64

    Question Problem with Category-Import

    Hi Folks,

    We Import some Categories to our ML 8.0.1.2 via XML-Import. The interesting Part of the XML-File is the following:

    <AspDotNetStorefrontImportFile>
    <Category>
    <Name>01</Name>
    <ParentCategory></ParentCategory>
    <Summary>Some Summary</Summary>
    <Description>Some Description</Description>
    <SETitle>Some SETitle</SETitle>
    <SEKeywords>Some Keywords</SEKeywords>
    <XmlPackage>entity.simpleproductlist.xml.config</XmlPackage>
    </Category>
    <Category>
    <Name>01.00</Name>
    <ParentCategory>01</ParentCategory>
    <Summary>Some Summary</Summary>
    <Description>Some Description</Description>
    <SETitle>Some SETitle</SETitle>
    <SEKeywords>Some Keywords</SEKeywords>
    <XmlPackage>entity.simpleproductlist.xml.config</XmlPackage>
    </Category>
    <Category>
    <Name>01.00.010</Name>
    <ParentCategory>01.00</ParentCategory>
    <Summary>Some Summary</Summary>
    <Description>Some Description</Description>
    <SETitle>Some SETitle</SETitle>
    <SEKeywords>Some Keywords</SEKeywords>
    <XmlPackage>entity.simpleproductlist.xml.config</XmlPackage>
    </Category>
    <Category>
    <Name>01.00.020</Name>
    <ParentCategory>01.00</ParentCategory>
    <Summary>Some Summary</Summary>
    <Description>Some Description</Description>
    <SETitle>Some SETitle</SETitle>
    <SEKeywords>Some Keywords</SEKeywords>
    <XmlPackage>entity.simpleproductlist.xml.config</XmlPackage>
    </Category>
    <Category>
    <Name>01.00.030</Name>
    <ParentCategory>01.00</ParentCategory>
    <Summary>Some Summary</Summary>
    <Description>Some Description</Description>
    <SETitle>Some SETitle</SETitle>
    <SEKeywords>Some Keywords</SEKeywords>
    <XmlPackage>entity.simpleproductlist.xml.config</XmlPackage>
    </Category>
    </AspDotNetStorefrontImportFile>


    All the Categories are added to the DB, so far so good.


    But after importing, the Tree of the Categories is like this:
    01
    >>01.00
    >>>>01.00.010
    01.00
    >>01.00.020
    >>01.00.030


    That is wrong. It should be

    01
    >>01.00
    >>>>01.00.010
    >>>>01.00.020
    >>>>01.00.030


    What am I missing? I guess the Lines <ParentCategory> should be fine...? And what's the difference between 01.00.010 and 01.00.020/030?

    Thank you very much,

    With kind regards,
    Michael

  2. #2
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    You're not using proper XPath syntax: /cat1/cat2/cat3

    Try: <XPath>/01/01.00/01.00.010</XPath>
    Last edited by ASPAlfred; 03-12-2010 at 06:18 PM.

  3. #3
    MiBfinity is offline Member
    Join Date
    Jul 2008
    Posts
    64

    Default

    So, what is the line <parentcategory> used for?

    That worked on ML/DNN. OK, i guess I have to Check our exportscripts. This worked in our ML/DNN-Installation.

    Thank you!

    Regards,
    Michael

  4. #4
    MiBfinity is offline Member
    Join Date
    Jul 2008
    Posts
    64

    Default

    Isn't CategoryRef a XML-Line for Productimport? It doesn't seem to have an effect on categories?

  5. #5
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Sorry for the confusion.

    Here's the full syntax:

    <AspDotNetStorefrontImport Verbose="true">
    <Entity EntityType="Category" Action="Add" >
    <Name>Sub Category 1</Name>
    <XPath>/A/Sub Category 1</XPath>
    </Entity>
    <Entity EntityType="Category" Action="Add" >
    <Name>Sub Category 2</Name>
    <XPath>/A/Sub Category 2</XPath>
    </Entity>
    </AspDotNetStorefrontImport>

  6. #6
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    ParentCategory node should be full XPath to parent (that's safest way to do this)..

    e.g.

    /cat1/cat1-1/cat1-1-1

    (when adding a sub UNDER cat-1-1-1)

    for example.

    otherwise, we have to lookup by "name" but sites can have multiple categories in different XPaths with the same name (that is allowed of course)
    AspDotNetStorefront
    Shopping Cart