It seems as though GetVariantGroups returns the data in node Id order?
Is it possible to return the variant groups in the order they appear in Umbraco? Or is there some other way that I can determine the order that the variant groups are retrieved in?
Check out the TeaCommerce.Umbraco.Configuration.Variants.Services.AVariantService in Tea Commerce for Umbraco to see how it works. You can always make your own implementation if you need something a little different.
https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/
Or you can get the IPublishedContent's afterwards and do your own sorting.
this issue has resurfaced and I think I need more help in order to solve it. Because we use the "Combinations" array and the order of the data in it, I think I need to override the default sorting by node Id. I need it to be returned in the order the Variant Groups / Types appear in Umbraco.
I have started to look at the code you pointed to above, but I would be very grateful for some sort of starting point example, if possible!?
The code that Rune sent a reference to is what is used in Tea Commerce. We don't have code examples of how to do it differently. So you will have to give it a try again or write to [email protected] about paid support/help.
Sort Variant Groups
It seems as though GetVariantGroups returns the data in node Id order?
Is it possible to return the variant groups in the order they appear in Umbraco? Or is there some other way that I can determine the order that the variant groups are retrieved in?
Hi Gordon,
Check out the TeaCommerce.Umbraco.Configuration.Variants.Services.AVariantService in Tea Commerce for Umbraco to see how it works. You can always make your own implementation if you need something a little different. https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/
Or you can get the IPublishedContent's afterwards and do your own sorting.
/Rune
Hi Rune,
this issue has resurfaced and I think I need more help in order to solve it. Because we use the "Combinations" array and the order of the data in it, I think I need to override the default sorting by node Id. I need it to be returned in the order the Variant Groups / Types appear in Umbraco.
I have started to look at the code you pointed to above, but I would be very grateful for some sort of starting point example, if possible!?
Hi Gordon
The code that Rune sent a reference to is what is used in Tea Commerce. We don't have code examples of how to do it differently. So you will have to give it a try again or write to [email protected] about paid support/help.
Kind regards
Anders
is working on a reply...