Developer forum

Forum » Development » eCommerce Product - Create language versions programmatically

eCommerce Product - Create language versions programmatically

Jon Lennryd
Reply
Hi, I have tried all sorts of ways to create several versions of a product, in different languages.

Ex:
// Ok,creates a row in EcomProducts:
Product p = Product.Create("PROD138", "", "LANG3");
p.Save();
// Fails, as "PROD138" is already there.
Product p = Product.Create("PROD138", "", "LANG2");
p.Save();

But this should work! The insert query equivalent would be "INSERT INTO EcomProducts (ProductID,ProductLanguageID,...) VALUES ('PROD138','LANG2',....)";

As for now I use the insert above, but I spent far too much time trying to use the interface of Product. Is there any way I could not figure out how to do it?





Replies

 
Vladimir
Reply
Hi Jon!
Try please to use this sentence:
Product p = Product.Create("PROD138", "", "LANG2");
p.Save("PROD138", "", "LANG2");

Best regards,
Vladimir

 

You must be logged in to post in the forum