Developer forum

Forum » Templates » Group order in VariantGroups template loop

Group order in VariantGroups template loop

Arnór Halldórsson
Arnór Halldórsson

Hola amigos,

I noticed that the template loop VariantGroups in the Product templates is not ordered according to the VariantGroupProductRelationSorting column in the EcomVariantGroupProductRelation table but rather just the order in which the rows are registered in the table.

We use this loop in some templates to render up the variant selections but this causes them to get rendered in an incorrect order.

Is this expected behaviour or a whoopsie doodle?

I added an image example of the data in the db, VARGRP1 stands for Size and VARGRP2 is Color, the order in the template should be VARGRP2.VARGRP1 according to the values in the VariantGroupProductRelationSorting... I'll admit that this is probably only happening because we're manually inserting these rows, even the IDs and AutoIDs of these rows tell us that they shouldn't be reversed like this in the table but somehow it happened... Just wanted to flag this with you guys before I start shoveling through this table just to reverse some rows...

Best regards,





You must be logged in to post in the forum