cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Approach to remove Duplicate categories of product using Datahub before sending product to hybris

Former Member
0 Kudos
913

Hi All,

I have requirement to append categories to supercategory for product using datahub, for that I am using below code in customsaperpproduct-target-datahub-extension.xml.

   <attribute override="true">
   <name>supercategories</name>
   <collection>true</collection>                          


     <transformationExpression>resolve('CanonicalCustomCategory').categoryList</transformationExpression>
     <exportCode>supercategories(code,catalogVersion(catalog(id),version))[mode=append]</exportCode>
 </attribute>


Consider if I replicate supercetegories :- category1 , category2 first . And if second time I replicate supercetegories :- category1 ,category3 Then in hybris I am getting four categories i.e category1 ,category2,category1 ,category3 I want to remove this duplicate category i.e. "category1 " using datahub What is the best approach for this?

Thank you, Rasika

Accepted Solutions (0)

Answers (2)

Answers (2)

tino_kissig
Active Participant
0 Kudos

If your list of categories is complete than just remove the [mode=append].

Former Member
0 Kudos

Hi,

We are experiencing same issue. Super categories are overriding when we remove append mode. (Existing super categories are removing from Product when we trigger IDOCs)

Please let me know if you find solution on this.

thank you.

Regards, Guru

Former Member
0 Kudos

I create custom impex translator added it in supercategy header (in datahub) to resolved this issue

Find attached sample code.link text

Slava
Product and Topic Expert
Product and Topic Expert
0 Kudos

Rasika,

I'm not an expert on impex but suspect it's that [mode=append] that causes the duplicates. At least the sample pcm-apparel extensions distributed with the solution book behave as you want.

Former Member
0 Kudos

Any suggestion ?