Developer forum

Forum » Development » Import/Export: No sorting on first level groups

Import/Export: No sorting on first level groups


Reply
Hi,

When importing groups in level 1 using following xml element, the SortOrder seems to be ignored:

****
<Shop>
 <ID>SHOP1</ID>
 <SortOrder>1</SortOrder>
</Shop>
****

as ShopGroupRelationsSorting is still 0 in the table EcomShopGroupRelation.

The sortorder should be ok according to the schema:

<!-- Shop is a replacement for Shops offering SortOrder, 06-29-2009 -->
 <xs:element name="Shop" minOccurs="0" maxOccurs="1">
   <xs:complexType>
     <xs:all>
       <xs:element name="ID" type="xs:string" minOccurs="1" maxOccurs="1" />
       <xs:element name="SortOrder" type="xs:string" minOccurs="0" maxOccurs="1" />
     </xs:all>
    </xs:complexType>
  </xs:element>

If the sorting is manually changed in backend and exported back into XML the value is set.


Am I doing anything wrong?

PS. Sorting groups on level 2 or more (subgroups) works as expected

Sincerely,
Jonas

Replies

 
Reply
Hi Jonas,

A workaround could be that you hardcode a "static" placeholder group, which serves as a new level 0 in our shop.
That way you can use ParentGroups to handle sorting.

In you XSLT you can code a logic that if a group has no parent, you insert something like the below.

    <ParentGroups>
      <ParentGroup>
        <ID>GROUP1</ID>
        <SortOrder>{OUR SORT ORDER}</SortOrder>
      </ParentGroup>
    </ParentGroups>

I've done something like that before, and it works great :-)

It's also nice the have your real shop groups and your other static groups like Search, Top products and so worth seperated.

//Martin
 
Reply
Martin, thanks for confirming this bug and thanks for the tip.

I'll try to do this and tell you how it went :)

Cheers,
Jonas

 

You must be logged in to post in the forum