order names in a filter alphabetically

  • Posts: 63
  • Thank you received: 2
12 years 6 months ago #50301

i have a filter based on a custom field. on front end i have displayed that filter in a fieldset above products. i have lots of names in that one filter dropdown. is there any way i can make them display alphabetically?

thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 6 months ago #50382

There is no option for that. Enter the names in alphabetical order in the custom field and they will be displayed in that same order.

Please Log in or Create an account to join the conversation.

  • Posts: 63
  • Thank you received: 2
12 years 5 months ago #51654

i have too many names in there. its really difficult to do that. if you don't mind can you please tell me if that is achievable by changing a select query in classes/filter.php file

if yes please help me by telling how?

I would really appreciate your help.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 5 months ago #51721

Not a query but you can try to add the line:
sort($field->field_value);
after the line:
$field->field_value=explode("\n", $field->field_value);

in that file.

The following user(s) said Thank You: leowaqqas

Please Log in or Create an account to join the conversation.

  • Posts: 63
  • Thank you received: 2
12 years 5 months ago #51730

that was great Nicolas. worked as I wanted. thanks a lot for such a quick response.

can we do something similar to the "Manufacturer" filter as well?

and also manufacturers in "add a new product" at back end? i have a long list of Manufacturers and its really difficult finding the right one if they are not in alphabetic order.

thanks once again

Last edit: 12 years 5 months ago by leowaqqas.

Please Log in or Create an account to join the conversation.

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 5 months ago #51806

Manufacturers are ordered by their ordering number. Just make sure that they are in the order you want via the manufacturer listing.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum