November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
The contentrepository for comerce should work just like cms. So if you whatever languange branch you are working in should be the one that is updated.
Load the content in the second language you want to edit, clone, update and save:
var productNodeGerman = _contentRepository.Get<Core.Models.MetaData.ProductNode>(contentLink, new LanguageSelector("de"));
productNodeGerman = (Core.Models.MetaData.ProductNode)productNodeGerman.CreateWriteableClone();
productNodeGerman.Name = "Deutsch";
_contentRepository.Save(productNodeGerman, SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);
This is somewhat different from CMS where you have to create the language version. In commerce all languages are immediately available (but with empty property values) so you skip that step and work like you would do the second time you edit content in CMS.
Hi,
When createing/updating nodes and entries from code how do you specify what language version you want to update?
I have the following code,
-------------
var productNode = _contentRepository.GetDefault<Core.Models.MetaData.ProductNode>(parentReference);
productNode.Name = _catalogRepository.GetSafeProductName(name);
productNode.Code = code;
productNode.DisplayName = name;
return _contentRepository.Save(productNode, SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);
-------------
and that creates the node and sets the english "DisplayName" property to name but the catalog also supports germany, how do I set the german DisplayName property? Same with entries but I suspect that the code is the same for the two?
/Viktor