I have a weird behavior on multiple language ecommerce.
When I get a product with the ProductService or old way by specifying LanguageId parameter I thought that getting the Groups on the object would have the same language.
Bare in mind that this code is executed in Backend context or without having set the ecommerce language on your website settings.
But it doesn't the groups are all in the solutions default language!
Shouldn't the groups follow the language id of the product itself?
The code:
Response.Write("Calling: Dynamicweb.Ecommerce.Services.Products.GetProductByNumber(\"1001-blue\", \"LANG2\")" + System.Environment.NewLine); var product = Dynamicweb.Ecommerce.Services.Products.GetProductByNumber("1001-blue", "LANG2"); Response.Write("Found product: Name: "+ product.Name +", ProductId: "+ product.Id + ", LangID: "+ product.LanguageId + System.Environment.NewLine); Response.Write("Now calling product.Groups" + System.Environment.NewLine); foreach (var group in product.Groups) { Response.Write("Group Name: "+ group.Name +", Group LanguageID: "+ group.LanguageId + System.Environment.NewLine); }
This produces this output
Calling: Dynamicweb.Ecommerce.Services.Products.GetProductByNumber("1001-blue", "LANG2") Found product: Name: Mit Product updated, ProductId: PROD1, LangID: LANG2 Now calling product.Groups Group Name: Beds, Group LanguageID: LANG1