6

In Magento 1.x you could import different content for each store view by having each store data in new line and empty sku field. Unfortunately this seems not to work in Magento 2 and I could not find any information about it. The official docs are not very helpful on this matter.

I tried with following CSV:

sku,store_view_code,name
1111,,"Default name"
,et,"Translated name"

This results in error:

Please make sure attribute "sku" is not empty

I also tried to import translations separately, adding store_view_code with appropriate value:

sku,store_view_code,name
1111,et,"Translated name"

This actually did import content to correct store view, but it also deleted default name from database.

I do understand that I could just insert translations to catalog_product_entity_varchar and similar, with some custom script, but isn't there really no official/non-coding way of doing this in Magento 2?

11

Apparently the solution is pretty simple. Too bad there is no word about it in official docs. My second approach in OP is almost correct, but you have to import all store views together in one import, including default. Separate import will reset field data for all store views and keep only the one's in last import. Difference with 1.x is that sku must be set for each store view. So the correct Magento 2 way should be something like this:

sku,store_view_code,name
1111,,"Default name"
1111,et,"Translated name"
1111,ru,"Another translation"

Note that this CSV will not work as initial import, but only as update of already existing product. You need to add required attributes for initial insert.

  • It works for name field, but not for price. Is it supposed to work for price field too? – Garry Apr 12 '17 at 23:28
  • Dont forget to set the "Catalog Price Scope" to "website" at Stores>Configuration>Catalog>Catalog>Price. Otherwise the price will remain same for all stores – Garry Apr 12 '17 at 23:35
  • Do you find a way to make this work as initial import for new products ? – Franck Garnier Feb 26 '18 at 18:37
  • I'm curious about a case : If we have to import into only et store for example, can we omit 1111,,"Default name" without consequence (I mean I'm not sure if all attributes are configurable in a non-root store) – medmek Oct 24 '18 at 13:53
  • 1
    @medmek no, that was the point. Default must always be imported too. If you only import one store view, all else will be deleted. Disclaimer: I gathered this comment from this answer, not recent knowledge about Magento. OP was posted 3 years ago. – ruuter Oct 24 '18 at 16:44
0

It seams the selected answer from @ruuter is now not right any more. I use Magento 2.3.2 and I tried the Import for only 1 Store like:

sku,store_view_code,name
1111,et,"Translated name"

and selected "Add/Update" as "Import Behavior". It only updated the storeview data leaving the other stores and the default value as it is. Maybe the old behavior was a bug, that is now fixed.

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.