Hi All
i'm getting crazy about admin customers.php. i want only, that the standard sort_order whenn customers.php is open it should sort for customers_id DESC (so i see the newest registration on top)
On line 118 is: $customers_sql = $customer_data->add_order_by($customers_sql, ['sortable_name']);
whenn i change it to: $customers_sql = $customer_data->add_order_by($customers_sql, ['id'])." DESC"; it works, but that's for sure not the correct way. thank you for pointing me to the right way
Sort order of customers.php
- burt
- Core Team
- Posts: 4551
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Sort oder of customers.php
['id' => 'DESC']
should do it
or
'date_account_created'
would also work, no?
should do it
or
'date_account_created'
would also work, no?
I am not here to build for you.
I am here to build with you. Let's help each other.
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: Sort order of customers.php
Found this thread through a search.
Is there a way to sort the order of the customers to newest first in the admin customers list using a hook, rather than changing core code?
Is there a way to sort the order of the customers to newest first in the admin customers list using a hook, rather than changing core code?
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Sort order of customers.php
Not that I know of, but the order is controlled by the sortable_name customer data module. The default install uses https://github.com/CE-PhoenixCart/Phoen ... name_2.php but you could install one that used a different sort. The sort order is defined at https://github.com/CE-PhoenixCart/Phoen ... hp#L61-L65 in the original file.
I.e. create a new cd_sortable_id_desc.php module that implements sortable_name and change the sort function accordingly. Uninstall the current module and install the new module.
S04e03 includes a module that already does this.