Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Where did AssociationTypeDefinition go, and why!?


A while back, we had the following code in our solution:

var associationTypeRepository = context.Locate.Advanced.GetInstance>();

associationTypeRepository.Add(new AssociationGroupDefinition()() { Name = Constants.AssociationTypes.RecommendedProducts });
associationTypeRepository.Add(new AssociationGroupDefinition()() { Name = Constants.AssociationTypes.Accessory });

...which added associationTypes to product relations. When importing a bunch of products, these were used. Also, we created stuff manually to set them. Worked fine.

Then, a few versions ago, this class (AssociationGroupDefinition) was marked as obsolete with the message "This is no longer in use.". No explanation to what, where, why and how to proceed. Nothing is explained in documentation as far as I and Google can find out either.

Changed to "RelationGroupDefinition", wich kindof seems to work, but on new products/variants now I only get "Default" in the dropdown list. On products that have one of the two others already, I can still choose between them. <= this article says ">You can define association keys in Commerce Manager." in one of the code examples. But where? I can't find it, at least...

This is limiting our client in his getting-ready for launch, and with only two weeks left and plenty to do, this is the last kind of bug we need. When doing such changes, mark classes as Obsolete with the second parameter set to true so we cant avoid it, and tell us how to replace things in the obsolete-message. now what?

Oct 03, 2014 14:17

..and when I ask for associationTypeRepository.List() I do get all three (Default + RecommendedProduct+ Accessory) back. So they are obviously stored. But it doesn't seem like the editing GUI gets it's values from the right place...

Oct 03, 2014 14:31

Allright, I found where: When editing a product => Associations => Add an association => save the product.

That adds the new Association group to that specific product's choice of relation types, but only to that one product - essentially making it a completely useless option.

Oct 03, 2014 15:12


I'm sorry to say the change related to what you're seeing (AssociationGroupDefinition marked as obsoleted, etc ...) was from a bad bug fix, which we decided to revert and introduced a better one.

The fix is now under testing and should be released after 8.0 release.



Oct 03, 2014 17:47

Soooeh...when will that be? We're two weeks away from launching a new site now, and this is something that is in use. And will be needed for new product creations these last remaining days...

Oct 05, 2014 20:05

The bug itself is fixed, and will be under testing after we release 8.0 (which should happen very soon!). I would expect it to be released in two weeks.

For your site, it's less than optiomal but you might use Commerce Manager for the association edit in the meantime.



Oct 06, 2014 3:54

I have installed Commerce 8 now - what are the new APIs I need to use to add my AssociationGroupTypes?

Oct 07, 2014 18:28

As I mentioned, we'll release a proper bug fix after Commerce 8 - which should be 8.0.1 (under testing right now).

This fix will bring back AssociationGroupDefinition which proper behavior in Catalog UI.



Oct 08, 2014 5:13

Ah, allright.

Oct 08, 2014 8:26
* 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.