Developer forum

Forum » Ecommerce - Standard features » Sorting the variants

Sorting the variants

Manon Wekking
Reply

Hi, 

For a customer we want to sort the variants. Is this possible as the same way as the products? 

I already tried sort ascending and sort descending but when I save then it change the sorting to as it was before. Is this a bug? Should this normally work and also sort then like that on the frontend?

BR, 

Manon Wekking

Sorting_variants.PNG

Replies

 
Nicolai Pedersen
Reply

Hi Manon

Could you ellaborate where you want the sorting? Is in the product list with 'exploded' variants, or is it in the product detail page where you show the options, or the list of available variant combinations? Would like to understand in what context - preferably the loop you are in.

Thanks for clarifying!

BR Nicolai

 
Manon Wekking
Reply

Hi Nicolai, 

We would like to sort the list on the product detail page. You can check is on: http://yamada.test1.innovadis.com/our-pumps/ndp-05/polypropylane-(ppg)-teflon%C2%AE-(ptfe)-ryton-air-motor 

Hope you have a good tip for us. 

BR Manon

 
Nicolai Pedersen
Reply

Thanks - so is that a list of options or combinations?

Options can be sorted from the Ecommerce variant settings.

The sorting you use is strictly UI and cannot be persisted
Combinations (Table EcomVariantOptionsProductRelation in database) currently does not have a sort column, så cannot be sorted manually.

It would be simple enough to sort them alpabetically though using LINQ in the template.

BR Nicolai

 
Manon Wekking
Reply

It is a list of combinations. 

I will try the LINQ if that works for the customer. Thank you so far. 

BR Manon

 

You must be logged in to post in the forum