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

Open to all! Ask other shopowners for help.
Post Reply
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

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

Post 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

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

Post 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
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

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

Post 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.
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

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

Post 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.
I am not here to build for you.
I am here to build with you. Let's help each other.
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

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

Post 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply