November Happy Hour will be moved to Thursday December 5th.

Epi Server product/categories relation

Vote:
 

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

#81648
Feb 21, 2014 16:47
Vote:
 

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

#81675
Feb 24, 2014 5:46
Vote:
 

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

#81685
Feb 24, 2014 10:17
Vote:
 

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

 

#81686
Edited, Feb 24, 2014 10:29
Vote:
 

@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);

    

#82070
Mar 05, 2014 10:28
Vote:
 

Hi, My mistake, I meant that you can't not set the SortOrder in the Admin UI in Commerce 7.5 - see my previous post.

Regards.

/Q

#82074
Mar 05, 2014 10:33
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.