Post by hfinlay10 » Mon Apr 28, 2014 7:18 pm

Hi all,

I am trying to get my list of customers to sort alphabetically, ignoring whether the name strats with an uppercase or lowercase letter. Currently the sort order lists all names A-Z followed by all names a-z. I just want all names Aa-Zz, ignoring case.

I can see in admin/model/sale/customer.php the following code (line 251):

Code: Select all

if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {

			$sql .= " ORDER BY " . $data['sort'];	
		} else {
			$sql .= " ORDER BY name";	
		}
but don't know how to manipulate it to do what I want. I believe "ORDER BY LOWER()" should work somehow but can't figure out the syntax.

Obviously I don't know much PHP! Any help appreciated.

TIA :)

New member

Posts

Joined
Thu Apr 12, 2012 8:20 am
Location - Australia

Post by Qphoria » Mon Apr 28, 2014 9:19 pm

Try this mysql help post.. There are many options so you may have to play with it a bit:
http://forums.mysql.com/read.php?10,225 ... msg-225465

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by hfinlay10 » Mon Apr 28, 2014 9:47 pm

Thanks, I'll check that out.

EDIT: Sadly, that wasn't much help. :(

New member

Posts

Joined
Thu Apr 12, 2012 8:20 am
Location - Australia

Post by rph » Tue Apr 29, 2014 12:00 am

If you're using OpenCart 1.5.4.1 or earlier try change the database collation to utf8_general_ci. Older versions used utf8_bin which is case sensitive.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by hfinlay10 » Tue Apr 29, 2014 6:56 am

Thanks for the reply. Where would I find that setting? The only place I have found "utf8_bin" is in admin>model>catalog>news.php, which seems unlikely to fix my problem.

New member

Posts

Joined
Thu Apr 12, 2012 8:20 am
Location - Australia

Post by rph » Tue Apr 29, 2014 9:36 am

You would need to modify your database through a program like phpMyAdmin.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska
Who is online

Users browsing this forum: No registered users and 63 guests