One of the neat things about WP e-Commerce is the vast array of filters and actions available. I had a client ask me this week for a custom sorting routine for their variations on the front-end.
For anyone unaware – variations are essentially different attributes of a product. If the product were a T-shirt, for example, variations would be Size (with Small, Medium and Large) as options or Color (Black, Red, Green), etc.
The code below would allow you to sort each group (and options within that group) according to a custom sorting algorithm. A pretty handy little code snippet!