Skip to content

Commit

Permalink
use the SORT_NATURAL flag for sorting attributes (#896)
Browse files Browse the repository at this point in the history
this allows numeric values to show up their expected order.
Previously an attribute with various numeric values would show up in the following order:

0-50
101-250
250+
51-100

After the change they will show up as:
0-50
51-100
101-150
250+
  • Loading branch information
danklassen authored Oct 2, 2024
1 parent 1ef8910 commit 7c05460
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blocks/community_product_filter/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public function view()
}

foreach ($attributemapping as $attrhandle => $values) {
ksort($attributemapping[$attrhandle]);
ksort($attributemapping[$attrhandle], SORT_NATURAL);
}
}

Expand Down

0 comments on commit 7c05460

Please sign in to comment.