Post by custompilotshirts » Sat Sep 24, 2011 1:32 am

hello, I just migrated all my data from oscommerce to opencart. In my admin on the opencart when I go to my customer list they are listed in order of first name alphabetically. Is there a way to get them to be listed by last name? Also, how about getting the date to be formatted mm/dd/yyyy also. I'm not used to dd/mm/yyyy. (VER 1.5.1)
Rob
Last edited by custompilotshirts on Mon Sep 26, 2011 5:13 am, edited 2 times in total.

New member

Posts

Joined
Sat Sep 10, 2011 4:30 am

Post by uksitebuilder » Sat Sep 24, 2011 4:03 pm

open: admin/model/sale/customer.php

find

Code: Select all

		if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
			$sql .= " ORDER BY " . $data['sort'];	
		} else {
			$sql .= " ORDER BY name";	
		}
change to

Code: Select all

		if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
			$sql .= " ORDER BY " . $data['sort'];	
		} else {
			$sql .= " ORDER BY c.lastname";	
		}

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by custompilotshirts » Mon Sep 26, 2011 4:35 am

Simon, I did exactly that and it still didn't order them by last name. Any other ideas?
Rob

New member

Posts

Joined
Sat Sep 10, 2011 4:30 am

Post by uksitebuilder » Mon Sep 26, 2011 4:56 am

This is strange, but in addition to the change above, you also need to do this change

open: admin/controller/sale/customer.php

find:

Code: Select all

		if (isset($this->request->get['sort'])) {
			$sort = $this->request->get['sort'];
		} else {
			$sort = 'name'; 
		}
change to

Code: Select all

		if (isset($this->request->get['sort'])) {
			$sort = $this->request->get['sort'];
		} else {
			$sort = 'c.lastname'; 
		}


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by custompilotshirts » Mon Sep 26, 2011 5:07 am

Thanks. They are now arranged by last name in the customer list.

New member

Posts

Joined
Sat Sep 10, 2011 4:30 am

Post by markman-b » Thu Oct 13, 2011 9:58 pm

It seems this doesn't work for OC 1.5.1.3, right?

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by uksitebuilder » Thu Oct 13, 2011 10:05 pm

Just changing the controller file should work

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by markman-b » Thu Oct 13, 2011 10:15 pm

Not on this site :(

Lastnames sequence in OC:
1= K...
2= Z....
3= B...

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by sunsys » Mon Nov 30, 2015 3:39 pm

uksitebuilder wrote:Just changing the controller file should work
@uksb: sir, I want to list latest customers on top or first in the list so how do I change this in oc-2.0.3.1, now it is sorting by customer name which is senseless.

Thank You for your time.

Regards,
Sun Systems
Industrial Electronics and Instrumentation


User avatar
Active Member

Posts

Joined
Tue Jan 27, 2015 5:19 am
Who is online

Users browsing this forum: No registered users and 2 guests