Skip to content

Instantly share code, notes, and snippets.

@vsguts
Created December 11, 2015 07:06
Show Gist options
  • Save vsguts/8312824ed520c3bbd6eb to your computer and use it in GitHub Desktop.
Save vsguts/8312824ed520c3bbd6eb to your computer and use it in GitHub Desktop.
diff --git a/app/functions/fn.catalog.php b/app/functions/fn.catalog.php
index fd35e5a..baae27c 100644
--- a/app/functions/fn.catalog.php
+++ b/app/functions/fn.catalog.php
@@ -10295,10 +10295,13 @@ function fn_get_current_filters($params, $filters, $selected_filters, $area = AR
} elseif ($structure['condition_type'] == 'F') {
$field_variant_values[$filter_id]['variants'] = db_get_hash_array(
- "SELECT $db_field as variant_id, $structure[variant_name_field] as variant FROM ?:$structure[table] $table_alias ?p " .
- "WHERE 1 ?p " .
- "GROUP BY $db_field", 'variant_id',
- $fields_join . $join, $fields_where . $where);
+ "SELECT $db_field as variant_id, $structure[variant_name_field] as variant"
+ . " FROM ?:$structure[table] $table_alias ?p"
+ . " WHERE 1 ?p"
+ . " GROUP BY $db_field"
+ . " ORDER BY $structure[variant_name_field] ASC",
+ 'variant_id', $fields_join . $join, $fields_where . $where
+ );
}
foreach (array('prefix', 'suffix') as $key) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment