I am trying to make a CSV template for mass import and would like it to be as clean as possible. I'm using Magento 1.9 with the Value Replacer v0.0.8a plugin in MagMI I hoped to use the same value across 3 headers without having to copy it in the CSV.

Specifically the "image" header cloned to "small_image" and "thumbnail".

I've tried:

Replaced attributes: small_image,thumbnail

small_image: {{ '{item.small_image}' == '' ? '{item.image}' : '{item.small_image}'}}
thumbnail: {{ '{item.thumbnail}' == '' ? '{item.image}' : '{item.thumbnail}'}}

Using this method seems to work but Image attributes processor (1.0.31) cant find the images for the 2 new columns. If I disable Value Replacer I can enter the columns manually and confirm it works for all 3 pictures.

Here is the sample CSV:

"12333444","admin","Default","simple","t-shirt","2.95","1","1","4","/test.jpg","0.01","shirts","2","Great Planes","Traxxas","RTR","0","3200","11.1V","",""
"2222","admin","Batteries","simple","11.1v 2600MaH","29.95","1","1","4","11_1v_2600mah.jpg","1","Batteries/3s","2","Great Planes","Tenergy","","","2600","11.1v","lipo",""

Any help is appreciated.


the small_image & thumbnail columns are not present in your csv.

so the test {item.small_image}=='' cannot be done and will probably issue a warning but also will not be true.

the following formulas will work better:

small_image : {{ (isset({item.small_image}) && !empty({item.small_image})?{item.small_image}:{item.image} }}
thumbnail : {{ (isset({item.thumbnail}) && !empty({item.thumbnail})?{item.thumbnail}:{item.image} }}

You can see i don't use any quotes, since {item.xxx} will be used as php variables ($item['xxx']).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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