Basically I have a collection of products, which all have location codes.
These codes start with W1 or W2 or W3, followed by another letter and some numbers (irrelevant beyond the third character for this problem)
So for example: W1A..., W1B..., W2P..., W2Z...
Now the thing is I want to sort the products in a specific order depending on the location codes.
The order should be W2 first, but in the order of W2Z... to W2A..., and after that comes W1, in order of W1A... to W1Z..., and after that W3 in W3A... to W3Z...
How could I write a custom sort function / query that achieves this order of the products, based on the string value of their location?