Hi,
For the relation between product and category, you can set the SortOrder when you create a NodeEntryRelation. Unfortunately you can only specify the SortOrder value by Commerce Manager UI, not the new Catalog UI.
For "other information", I don't know details about your requirements, but I suggest the MetaField/MetaClass approach as a starting point to solve your problem. You can add metafields to you product's metaclass to store information about the relation.
Regards.
/Q
Hi Quan Mai,
Thanks for the update!
I think this helped me a lot. The only problem that I have now is that I don't know how to set up the sort order when I create NodeEntryRelation. Basically I do this by using "move/link to folder" functionality. I haven't seen how the sort order could be manuplated from there.
Any ideas?
Regards,
Lena
Hi,
Here's some demo code to do so:
CatalogRelationDto catalogRelationDto= new CatalogRelationDto();
CatalogRelationDto.NodeEntryRelationRow row = newCatalogRelationDto.NodeEntryRelation.NewNodeEntryRelationRow();
row.CatalogId = targetCatalogId;
row.CatalogNodeId = targetCatalogNodeId;
row.CatalogEntryId = catalogEntryId;
row.SortOrder = <your indended sort order>;
catalogRelationDto.NodeEntryRelation.AddNodeEntryRelationRow(row);
CatalogContext.Current.SaveCatalogRelationDto(newCatalogRelationDto);
Regards.
/Q
@Quan: What do you mean setting sort order is not supported in 7.5? I just tested the following code in 7.5 and it works perfectly.
var referenceConverter = ServiceLocator.Current.GetInstance<ReferenceConverter>();
var contentLink = referenceConverter.GetContentLink(1073741830,0);
var onSaleNode = ContentLoader.Get<FashionNode>(contentLink);
var newNodeRelation = new NodeRelation()
{
SortOrder = 11,
Source = CurrentContent.ContentLink,
Target = onSaleNode.ContentLink
};
LinkRepository.UpdateRelation(newNodeRelation);
Hi guys,
We are currently using Epi Server Commerce 7.5 and I was wondering how relations between products and categories could be extended?
For example we have a scenario where a book must have a reference to its category(e.g. Mathematics). We need to set specific sort order to this relation, together with some other information. Is there a way to do that with Epi Server Commerce 7.5.
Is there a way to manage that via UI in the commerce catalogue?
Thanks,
Lena Hilfeling