In my Magento shop i have some categories like "Baby", "Persoonlijke verzorging", "Wonen" with sub categories like "Slaapkamer", "Woonkamer" etc.

From my manufacturer i have a large csv file with lots of categories and products. The categories names in the csv file of my manufacturer are ok, but i want them to be importerd under the already existing categories in my shop.

The csv file of my manufacturer looks like this: articleNumber title brand description ean weight stock price recommendedPrice taxPercentage categoryId1 categoryId2 categoryId3 categoryId4 categoryName1 categoryName2 categoryName3 categoryName4 image1 image2 image3 image4 image5 image6 image7 image8 image9 image10 delivery warranty 1030 "Hama 1030 Hamafix Diaramen 5x5 cm 100 Stuks" Hama "Materiaal: Kunstof Inhoud: 100 Diaformaat: 5 x 5 cm Filmformaat: KB 24 x 36 mm Uitvoering: Lijst Diadikte: 2,3 mm Systeem: Hamafix " 4007249010308 1 true 1 5 21 2593 3392 "Foto / Video" "Diaprojektoren / Accessoires" http://url.nl "Direct leverbaar"

What i want to do is import all the products with magmi and with use of the magmi "On the fly category creator/importer". But if the categoryname1 from the csv file of my manufacturer equals "Foto / Video" it must be imported under an already existing category of my shop, lets say "Wonen".

The Magmi column "Categories" should than be like "Wonen/Foto / Video"

Is this possible with Magmi? or do i have to write a php script for this? I also want to exclude some products and categories from the manufacturer csv file. Lets say, if there is a column in the csv file like "Bricks". This column and all the products assigned to this column in the csv file, should not be imported.

Hope you guys can help me out with this one.



This is doable using the ValueReplacer plugin which has interesting mapping capabilities.

You can use the ValueRemapper Helper of this plugin to use a mapping file between your input csv value & the values that are to be ingested by magmi. It can also create a composite value from several input columns (here you may use it to create a "categories" column that would aggregate the several categories from your input file)

For excluding values to import, the Import Limiter plugin can do it too by selecting rows to exclude based on any column criteria.

A Last option would be to use magmi programmatic APIs:

  • Datapump API would let you create a script that will wrap magmi calls letting you perform any operation on input data (but this would also mean you'll have to read the input file)
  • Creating a dedicated ItemProcessor plugin that would do data transformation suiting your needs in its "processItemBeforeId" method.
|improve this answer|||||
  • Hi Dweeves,Can you please send me a magmi profile with an exclude statement for categories and a valueremapper helper in it? I don't understand how you build up the "categories" column like this way. When you send me an example, a little bit of explanation would be very helpful. Many thanks – user3647736 May 19 '14 at 19:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.