Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customers.


alun

Recommended Posts

Posted

Hi,

The customer list is currently sorted by customer surname. I would like to sort it by joined date so I can more easily see the latest customers that have signed up.

Any suggestions?

 

I can probably alter the php file but would like something that allows me to choose the sort order rather than hard coding it.

 

Is there a mod out there?

Thanks,

Alun.

  • 2 years later...
Posted
Hi,

The customer list is currently sorted by customer surname. I would like to sort it by joined date so I can more easily see the latest customers that have signed up.

Any suggestions?

 

I can probably alter the php file but would like something that allows me to choose the sort order rather than hard coding it.

 

Is there a mod out there?

Thanks,

Alun.

I have the same question. Anyone have an answer? I have two customers with stores that want to modify the order in which their customers show up on the list.

Posted

Hi,

 

Open the file admin/customers.php and go to line #719

 

$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname";

 

change the query to:

 

$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS_INFO . " ci, " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_id = ci.customers_info_id and c.customers_default_address_id = a.address_book_id " . $search . " order by ci.customers_info_date_account_created";

 

Not tested but this should order the customer list by date created....

 

you may need to add ASC or DESC to the end of the query.....

 

 

cheers,

Peter M

Peter McGrath

-----------------------------

See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation

Posted

I should think about these things more so and not answer code before my first cup of coffee... :)

 

 

you need only change the same query to the following:

 

 

 

$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname";

 

to

 

$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_id DESC";

 

Since the customers id is associated to the time it was created (the larger the number, the more recent the entry). You do not need to modify the query to use the customers info table at all ;)

 

sorry and cheers :)

 

Peter M

Peter McGrath

-----------------------------

See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...