on ‎2018 Feb 16 8:56 AM
Hello Hybris Experts,
Am karthik new to Hybris product level.
Could you please advise me how to create new categories and add products into it using impex script.
Many Thanks in Advance
BR R venkata karthik
Request clarification before answering.
Hey Karthik,
this will create your categories:
$baseStoreCountry=baseStoreName
$productCatalog=ProductCatalog
$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
INSERT_UPDATE Category;code[unique=true];name[lang=de];name[lang=en];$catalogVersion
;"category-code";"Kategorie Name DE";"Category Name EN";
This will allow you to sort these categories in a hirarchy:
$baseStoreCountry=baseStore
$productCatalog=$baseStoreCountry-ProductCatalog
$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
$supercategories=source(code, $catalogVersion)[unique=true]
$categories=target(code, $catalogVersion)[unique=true]
INSERT_UPDATE CategoryCategoryRelation;$categories;$supercategories
;"child-category-code";"parent-category-code"
And this will associate the products with the category:
$baseStoreCountry=baseStore
$productCatalog=$baseStoreCountry-ProductCatalog
$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
$supercategories=supercategories(code, $catalogVersion)
$baseProduct=baseProduct(code,$catalogVersion)
$approved=approvalstatus(code)[default='approved']
UPDATE Product;code[unique=true];$supercategories
;116029;category-code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can I ask you how many category items will the following ImpEx create?
$prodCat=electronicsProductCatalog
$version=Staged
$catVersion=catalogVersion(catalog(id[default=$prodCat]), version[default=$version])
INSERT_UPDATE Category; code[unique=true];$catVersion[unique=true]
;test_category;electronicsProductCatalog
;test_category,apparelProductCatalog:$version
;test_category;:Online
;test_category;
Hi Karthik,
All the examples you need can be found in "/hybris/bin/ext-template/yacceleratorinitialdata/resources/yacceleratorinitialdata/import/sampledata/productCatalogs/catalogName"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.