Search code examples
cloneakeneo

Akeneo 1.6: Clone a product


We need to clone a product in Akeneo 1.6 (only the SKU should change).

We used the method described in the response to my old SO question, but this seems only to work in Akeneo 1.4 and 1.5.

I've tried to normalize the product to JSON, but I haven't found an easy way to write it back into a Product. Any ideas?


Solution

  • Simple way is to use the ProductQueryBuilder to fetch product from the database, then normalize them in array with the ProductNormalizer, change the SKU then use the ProductBuilder to create a product. You can now update it with the ProductUpdater and save it with the ProductSaver.

    Or if you don't want to develop anything you can export the desired products, change their SKU then reimport them :)