0
votes

How multiple categories can be removed and added to a product using impex in HYbris in a single row Something like:

REMOVE CategoryProductRelation;target[unique=true](code,$catalogVersion);source[unique=true](code,$catalogVersion)

;xyz;cat1,cat2,cat3
2

2 Answers

0
votes

You may also try :

$ProductCatalogVersion=catalogVersion(catalog(id[default='$catalogID']),version[default='$catalogVersionID_STAGED'])[unique=true,default='$catalogID:$catalogVersionID_STAGED']
$CategoryCatalogVersion=catalogVersion(catalog(id[default='$catalogID']),version[default='$catalogVersionID_STAGED'])[unique=true,default='$catalogID:$catalogVersionID_STAGED']

$superCategories=supercategories(code,$CategoryCatalogVersion)


INSERT_UPDATE Product;$ProductCatalogVersion;code[unique=true];$superCategories[mode = remove]
;;xyz;cat1,cat2,cat3

Hope this helps

0
votes

Remove it 1 line each.

 REMOVE CategoryProductRelation;target(code,$catalogVersion)[unique=true];source(code,$catalogVersion)[unique=true]

 ;xyz;cat1
 ;xyz;cat2
 ;xyz;cat3