Not sure I understand what you are trying to achieve, but Market works at entry level. Of course you can create catalog per market, but an easier approach would be tie market to language and use market to control which language to display.
Thanks, I see your point. Now I got another problem. I create a catalog for market, but then I need to add a language to this catalog. I use:
private void AddLanguageToCatalog(CatalogContent catalog, CultureInfo language)
{
var catalogInstance = catalog.CreateWritableClone() as CatalogContent;
if (catalogInstance != null){
catalogInstance.CatalogLanguages.Add(language.Name);
_contentRepository.Save(catalogInstance, SaveAction.Publish, AccessLevel.NoAccess);
}
}
But I get error: Unable to save catalog content. An existing catalog already have the selected name ''
What is wrong?
Hi all!
I am trying to create a catalog from code. Catalog with the same name should be created for two markets with different default languages and currencies.
var root = _referenceConverter.GetRootLink();
var catalog = _contentRepository.GetDefault(root);
catalog.Name = name;
catalog.DefaultLanguage = market.DefaultLanguage.Name;
catalog.DefaultCurrency = market.DefaultCurrency;
catalog.Language = market.DefaultLanguage;
catalog.WeightBase = "Kilograms";
_contentRepository.Save(catalog, SaveAction.Publish, AccessLevel.NoAccess);
Can I create one catalog in two languages with different currencies? How?
Inside of this catalog will be categories. They have the same structure: same name, same code, but different languages.
Example structure:
Market1, Market2
CatalogName (DefaultLanguage = Market1.DefaultLanguage, DefaultCurrency = Market1.DefaultCurrency) - CategoryName(Code, Language = Market1.DefaultLanguage)
CatalogName (DefaultLanguage = Market2.DefaultLanguage, DefaultCurrency = Market2.DefaultCurrency) - CategoryName(Code, Language = Market2.DefaultLanguage)
I tried to create one catalog instance for every market. It went well, but it doesnt work for categories since they have unique code
Please help!