[Question (in english) - remember to come back and check the answer that solves your question to mark it as resolved, formatting of messages with markdown]
Litium version: [6.3.7]
I’m working on an article import which needs to be modified, and in the part where variants are added to a MainCategory it is fetched like this:
var editableBaseProduct = baseProduct.MakeWritableClone();
mainCategory = editableBaseProduct.CategoryLinks.First(c => c.MainCategory);
Add variants to it:
mainCategory.ActiveVariantSystemIds.Add(variant.SystemId);
It is working fine but then I noticed that on a product with 2 categories, both of them had MainCategory as “true” when i was debugging, that shouldn’t be possible or should it?
If I use the GetMainCategory extension one category is returned. I went on to check in Litium/Plan section and saw that the category that was returned was not selected, the other category was, why is that?
Basically I need to know if I’m adding variants to the correct MainCategory.