# Sort oxVariantSelectList by oxSelection-\>\_sName

**URL:** <https://forum.oxid-esales.com/t/sort-oxvariantselectlist-by-oxselection--sname/76912>\
**Category:** English forums\
**Tags:** dev-talk\
**Created:** [May 9, 2017, 6:04pm UTC](https://forum.oxid-esales.com/t/sort-oxvariantselectlist-by-oxselection--sname/76912 "2017-05-09T18:04:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![esyon](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/e/c77e96/32.png) [@esyon](https://forum.oxid-esales.com/u/esyon)\
**Post date:** [May 9, 2017, 6:04pm UTC](https://forum.oxid-esales.com/t/sort-oxvariantselectlist-by-oxselection--sname/76912/1 "2017-05-09T18:04:19Z")

</div>

Hey,

What is the most appropriate way to sort the select box for product variants by their name?

I tried to sort the array of \_aList in the Object oxVariantSelectList:

E.g.

```auto

object(oxVariantSelectList)[18927]
  protected '_sLabel' => string 'Größe' (length=7)
  protected '_iIndex' => int 1
  protected '_aList' => 
    array (size=5)
      '02ce605576fee3181f11ebd2c87baed0' => 
        object(oxSelection)[18965]
          protected '_sName' => string 'Benny' (length=5)
          protected '_sValue' => string '02ce605576fee3181f11ebd2c87baed0' (length=32)
          protected '_blActive' => boolean false
          protected '_blDisabled' => null
      '690645228c86f17648b3a7b1286f1946' => 
        object(oxSelection)[18968]
          protected '_sName' => string 'Arvid' (length=5)
          protected '_sValue' => string '690645228c86f17648b3a7b1286f1946' (length=32)
          protected '_blActive' => boolean false
          protected '_blDisabled' => null
      '972b08df7f6a1a19405f28c1e984b115' => 
        object(oxSelection)[18969]
          protected '_sName' => string 'Chris' (length=5)
          protected '_sValue' => string '972b08df7f6a1a19405f28c1e984b115' (length=32)
          protected '_blActive' => boolean false
          protected '_blDisabled' => null
      '1ba5f38fd6213a22679a4eba30651390' => 
        object(oxSelection)[18970]
          protected '_sName' => string 'Alex' (length=5)
          protected '_sValue' => string '1ba5f38fd6213a22679a4eba30651390' (length=32)
          protected '_blActive' => boolean false
          protected '_blDisabled' => null
      'b0a471b33a911ce8fed459d607f0ffb3' => 
        object(oxSelection)[18985]
          protected '_sName' => string 'Mona' (length=5)
          protected '_sValue' => string 'b0a471b33a911ce8fed459d607f0ffb3' (length=32)
          protected '_blActive' => boolean false
          protected '_blDisabled' => null
  protected '_oActiveSelection' => null

```

We want sort the list by \_sName. I tried a smarty plugin with usort but this leads to a recreateion of the index and I loose the oxid of each List.

Do you guys have any ideas?

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![system](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/system/32/4245_2.png) [@system](https://forum.oxid-esales.com/u/system)\
**Post date:** [July 13, 2026, 7:41pm UTC](https://forum.oxid-esales.com/t/sort-oxvariantselectlist-by-oxselection--sname/76912/2 "2026-07-13T19:41:17Z")

</div>

Closed on July 13, 2026, 7:41pm UTC


