- Posts: 63
- Thank you received: 2
order names in a filter alphabetically
14 years 4 months ago #50301
by leowaqqas
order names in a filter alphabetically was created by leowaqqas
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
thanks
Please Log in or Create an account to join the conversation.
14 years 4 months ago #50382
by nicolas
Replied by nicolas on topic Re: order names in a filter alphabetically
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.
14 years 4 months ago #51654
by leowaqqas
Replied by leowaqqas on topic Re: order names in a filter alphabetically
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
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.
14 years 4 months ago #51721
by nicolas
Replied by nicolas on topic Re: order names in a filter alphabetically
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.
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.
14 years 4 months ago - 14 years 4 months ago #51730
by leowaqqas
Replied by leowaqqas on topic Re: order names in a filter alphabetically
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
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: 14 years 4 months ago by leowaqqas.
Please Log in or Create an account to join the conversation.
14 years 4 months ago #51806
by nicolas
Replied by nicolas on topic Re: order names in a filter alphabetically
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.197 seconds