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

how do i create a new product in electronic store and link media to it using impex?

Former Member

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi Aadithya

Below is an impex to import products

 productCatalog=electronicsProductCatalog
 $productCatalogName=Electronics Product Catalog
 $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='check']
 # Insert Products
 INSERT_UPDATE Product;code[unique=true];$supercategories;manufacturerName;manufacturerAID;unit(code);ean;variantType(code);$catalogVersion;$approved
 ;23210;576, brand_5;Sony;DSC-P71;pieces;4901780755943


Impex to import media and media container

 $productCatalog=electronicsProductCatalog
 $catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
 $thumbnail=thumbnail(code, $catalogVersion)
 $picture=picture(code, $catalogVersion)
 $thumbnails=thumbnails(code, $catalogVersion)
 $detail=detail(code, $catalogVersion)
 $normal=normal(code, $catalogVersion)
 $others=others(code, $catalogVersion)
 $data_sheet=data_sheet(code, $catalogVersion)
 $medias=medias(code, $catalogVersion)
 $galleryImages=galleryImages(qualifier, $catalogVersion)
 $siteResource=jar:de.hybris.platform.electronicsstore.constants.ElectronicsstoreConstants&/electronicsstore/import/sampledata/productCatalogs/$productCatalog
 
 INSERT_UPDATE Media;mediaFormat(qualifier);code[unique=true];@media[translator=de.hybris.platform.impex.jalo.media.MediaDataTranslator];mime[default='image/jpeg'];$catalogVersion;folder(qualifier)
 ;515Wx515H;/515Wx515H/23210.jpg;$siteResource/images/515Wx515H/23210.jpg;;;images
 
 INSERT_UPDATE MediaContainer;qualifier[unique=true];$medias;$catalogVersion
 ;23210;/515Wx515H/23210.jpg,/300Wx300H/23210.jpg,/96Wx96H/23210.jpg,/65Wx65H/23210.jpg,/30Wx30H/23210.jpg;

then update the product and attach media

 UPDATE Product;code[unique=true];$picture;$thumbnail;$detail;$others;$normal;$thumbnails;$galleryImages;$catalogVersion
     ;23210;/300Wx300H/23210.jpg;/96Wx96H/23210.jpg;;/515Wx515H/23210.jpg,/515Wx515H/23213.jpg,/515Wx515H/23231.jpg,/515Wx515H/65652.jpg,/65Wx65H/23210.jpg,/65Wx65H/23213.jpg,/65Wx65H/23231.jpg,/65Wx65H/65652.jpg,/30Wx30H/23210.jpg,/30Wx30H/23213.jpg,/30Wx30H/23231.jpg,/30Wx30H/65652.jpg;/300Wx300H/23210.jpg,/300Wx300H/23213.jpg,/300Wx300H/23231.jpg,/300Wx300H/65652.jpg;/96Wx96H/23210.jpg,/96Wx96H/23213.jpg,/96Wx96H/23231.jpg,/96Wx96H/65652.jpg;23210,23213,23231,65652;

Also look at the impexes in the following directory hybris\bin\ext-data\electronicsstore\resources\electronicsstore\import\sampledata\productCatalogs\electronicsProductCatalog

Former Member
0 Likes

thank you so much.Can also let me know the impex for populating the product features/different attributes along with the stock and price?

Former Member
0 Likes

Hi , can you please mark the answer as best answer or upvote so that others can also benefit. Stock & Price impexes are present in the same directory that I mentioned above.

Answers (0)