Hi all,
[using commerce 9.24]
A while back, I associated products (and variants) to Categories, by doing this:
// Create new Category relation: var nodeRelation = relations.NewNodeEntryRelationRow(); nodeRelation.CatalogId = _catalogId; nodeRelation.CatalogEntryId = catalogEntryId; nodeRelation.CatalogNodeId = targetCategoryNode.CatalogNodeId; nodeRelation.SortOrder = 0; if (nodeRelation.RowState == DataRowState.Detached) { relations.AddNodeEntryRelationRow(nodeRelation); } CatalogContext.Current.SaveCatalogRelationDto(relationsDto);
Today, I'd like to change those associations -- I'd like to associate those products with a different category (and thus remove the previous association).
How can I accomplish this programmatically?
Thanks!
- Ken