November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi again,
I found a way to relate the skus:
Entry entryArticle = CatalogContext.Current.GetCatalogEntry(catalogEntryId, new CatalogEntryResponseGroup(CatalogEntryResponseGroup.ResponseGroup.Associations));
Entry entryRelatedArticle = CatalogContext.Current.GetCatalogEntry(catalogEntryIdRelated, new CatalogEntryResponseGroup(CatalogEntryResponseGroup.ResponseGroup.Associations));
var association = CatalogContext.Current.GetCatalogAssociationDtoByEntryId(entryArticle.CatalogEntryId);
var row = association.CatalogEntryAssociation.AddCatalogEntryAssociationRow(association.CatalogAssociation[associationType], entryRelatedArticle.CatalogEntryId, 0, association.AssociationType[0]);
if (association.HasChanges())
{
CatalogContext.Current.SaveCatalogAssociation(association);
}
Hopefully someone finds this useful.
/Tim
Hi, I need to create relations/associations between different entry’s. I have found a way to get the correct name of a association through this code:
CatalogEntryDto entryDto = CatalogContext.Current.GetCatalogEntryDto(artNbr,
new CatalogEntryResponseGroup(CatalogEntryResponseGroup.ResponseGroup.CatalogEntryFull));
foreach (CatalogEntryDto.CatalogAssociationRow catalogAssociation in entryDto.CatalogAssociation)
{
Debug.WriteLine("Relation AssociationDescription: " + catalogAssociation.CatalogEntryRow.GetCatalogAssociationRows()[0].AssociationDescription);
Debug.WriteLine("Relation AssociationName: " + catalogAssociation.CatalogEntryRow.GetCatalogAssociationRows()[0].AssociationName);
}
Which gives the following output:
Relation AssociationDescription: Related description..
Relation AssociationName: Related
Which corresponds to the values entered to AssociationDescription and AssociationName when the associations where created.
My question is, how do I connect two skus programmatically so that they appear in commerce manager under: Catalog Management -> “folderX” -> “skuX” -> “edit” -> “Associations”
Regards,
Tim Hansson