Page 1 of 1

Is it possible to sort the order that hooks show in customers - order_staus page

Posted: Tue Oct 01, 2024 10:12 am
by 14Steve14
Phoenix 1.9.0. PHP8.0

Had a quick search but could not really find any answer.

Is it possible to sort the order that additional hooks show on the status_history page withing the customers orders area.

We have several hooks that add text boxes or check boxes into the status_history page within the customers orders section. Modules like canned comments, email review requests, and admin comments.

We would like to improve the page layout by moving the more popular and more used boxes to nearer the top of the section under the order status and other standard core components on the page whilst keeping the admin comments box at the bottom.

I hope that makes sense.

Re: Is it possible to sort the order that hooks show in customers - order_staus page

Posted: Tue Oct 01, 2024 10:34 am
by heatherbell
When more than one hook file is injected at one hook position they will be loaded sorted by their name.
Example 2: https://phoenixcart.org/phoenixcartwiki ... #Example_2

Re: Is it possible to sort the order that hooks show in customers - order_staus page

Posted: Tue Oct 01, 2024 11:17 am
by 14Steve14
heatherbell wrote: Tue Oct 01, 2024 10:34 am When more than one hook file is injected at one hook position they will be loaded sorted by their name.
Example 2: https://phoenixcart.org/phoenixcartwiki ... #Example_2
So if I am, understanding this correctly to change the order that the hooks show is to change the name of the hook to something that will sort alphabetically.

Re: Is it possible to sort the order that hooks show in customers - order_staus page

Posted: Tue Oct 01, 2024 2:47 pm
by burt
Correct.

But if you change the hook name, you also need to change the filename.

Eg if you have a hook here:

/includes/hooks/admin/catalog/xyz.php

the code inside will also be called somehting like

class hook_admin_catalog_xyz {

You need to rename that bit of code to match the new name of the file.
Bolded and Underlined for emphasis.

Re: Is it possible to sort the order that hooks show in customers - order_staus page

Posted: Thu Oct 10, 2024 4:28 pm
by 14Steve14
Thanks very much @burt and @heatherbell. Just changed the name of one file so it loads last and now admin page is better and easier to work with.