Has anyone got an example of how to copy/clone a variation in code (via IContent or Entry)? Basically I'm creating products in code and for each I need to create a copy of an existing variation, change the code and a few other fields, and save and link to the new product.
Sounds like it should be fairly simple (load up the original, change some fields (code, etc.), and save as new) in theory but unless I’m missing something it’s not working out that way!
Without testing, I believe you can call IContentRepository.Copy with the content reference of catalog content you want to clone, and point to same parent link. Some unique fields will be autogenerated.
Has anyone got an example of how to copy/clone a variation in code (via IContent or Entry)? Basically I'm creating products in code and for each I need to create a copy of an existing variation, change the code and a few other fields, and save and link to the new product.
Sounds like it should be fairly simple (load up the original, change some fields (code, etc.), and save as new) in theory but unless I’m missing something it’s not working out that way!
Cheers!