Developer forum

Forum » Integration » Retrieve parent groups of product

Retrieve parent groups of product

Filip Lundby
Reply

I've created an activity/task that exports all products into an XML using XSLT. In the activity I've mapped EcomProducts.

DW returns the groupname, but what I want is the groupname + all parent groups ... Like a breadcrumb. Is that possible?

Perhaps I should map more than just EcomProducts when creating the activity?

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  
  <xsl:output method="xml" indent="yes" cdata-section-elements="column" />
  
  <xsl:template match="/">

    <products>
        <xsl:for-each select="tables/table/item">

          <product>
            <group>
              <xsl:value-of select="column[@columnName = 'Groups']" />
            </group>
          </product>

        </xsl:for-each>
    </products>

  </xsl:template>

 


Replies

 
Dmitriy Benyuk
Reply

Hi Filip,
I am not sure if it is possible to do. For export Groups with Parent Groups like a breadcrumb it will be needed to built the hierarchy of groups by XSLT.
 

As for Groups hierarchy you need two tables to export: EcomGroups and EcomGroupRelations.
The table EcomGroupRelations contains the relations by ID and Parent ID.

 

 
Filip Lundby
Reply

I've got no EcomGroupRelations. But it seems EcomGroups is enough. EcomGroups has an item: ParentGroups - I'll try work something out.

Thanks Dmitriy

 

You must be logged in to post in the forum