hebcat Posted October 3, 2012 Share Posted October 3, 2012 Does anyone know how to order the Zones in the UK? This is a particularity of the UK, as it's made up of 4 countries. In CubeCart UK zones are listed like this: England Scotland Wales Northern Ireland. So when I add a zone (ie. a county), these get added at the bottom of the list, past Northern Ireland counties, and even past the bottom "Please Select". So how do I get, for example, "West Yorkshire" in the England section of the list? Most of my clients are in West Yorkshire, so I really have to figure this one out. I must add -- really, CubeCart, this is version 5 -- there really should be a correct list of UK counties by now. It's been a known issue since the very beginning. Really disappointed. Cat Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 3, 2012 Share Posted October 3, 2012 I just checked, and West Yorkshire is in my Zones list under United Kingdom already. I can't help, but someone who can will need to know your setup. Please create your sig. Quote Link to comment Share on other sites More sharing options...
hebcat Posted October 10, 2012 Author Share Posted October 10, 2012 Hi and thanks for answering. The latest version I've installed for a client was 5.0.8. I've attached a screenshot -- no West Yorkshire not here, anyone know if it's definitely an update between 5.0.8 and 5.1.4? ... And then if I add the 3 Yorkshires myself, here's where they show up Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 10, 2012 Share Posted October 10, 2012 There have been loads of changes since 5.0.8. It looks like it won't be too long before 5.1.5 is released. After waiting some time to be sure 5.1.5 doesn't have major bugs, you would certainly benefit from upgrading, and I suspect it would solve this problem for you. You really need to update your sig now to include your setup. Quote Link to comment Share on other sites More sharing options...
hebcat Posted October 10, 2012 Author Share Posted October 10, 2012 Thanks, I think I'll do that, I'll upgrade to 5.1.5; they're in a rush to get this live so maybe I'll have to pass by 5.1.4 first. Cheers for the reply & sig file updated. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 10, 2012 Share Posted October 10, 2012 If you try 5.1.4, be sure you look over the recent bug fixes, such as for SagePay. If you need USPS, you will have to to use By_Weight for right now, unless the file offered on the tracker works for you. There may be more there of importance. Thanks for the sig. It will help speed up responses from those who are knowledgeable here. Quote Link to comment Share on other sites More sharing options...
hebcat Posted November 15, 2012 Author Share Posted November 15, 2012 Sadly I'm back to square one, even after upgrading to 5.1.5 Well nearly -- in fact it's even weirder than before... Perhaps it's because I did an upgrade and not a new install -- and it remembered the previous three Yorkshires I'd added.... But they were still in the wrong place (bottom of the UK list). When I deleted them and added them back in, North & West Yorkshire went again to the very bottom of the UK list. But SOUTH YORKSHIRE went to between the bottom of the ENGLAND list -- above Scotland. I'm just stumped. Surely there's got to be a file somewhere or a part of the database that allocates zones to the four countries of the UK? I mean, how does CC5 know to put them in that geographical (and not entirely alphabetical) order in the first place? I really do need to sort this -- my client is in West Yorkshire... they're going to notice it, and some way or another I'm going to have to fix it. Any ideas I could try, anyone? Thanks Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 15, 2012 Share Posted November 15, 2012 Would you please try this experiment? Using a programmer's text editor: In the file /includes/functions.inc.php, the function state_json() (at around line 751): The line that starts with $counties = $GLOBALS['db']->query(... At the end of that line, make it look like this: ON gc.id=gz.country_id ORDER BY gc.name,gz.name'); The query, as it exists now, pulls records from the zone (aka county/state) table in the order they were written to the table. So adding South Yorkshire puts it at the bottom of the list - after Western Australia as far as the order of insertion in the zone table is concerned. Next, for each zone row, the ISO Number Code for that zone's country is attached. So, again, at the bottom of the list is South Yorkshire::826. Next, an array is built with the ISO Number Code as the key. So (along with all other zones in the 826 country), we get: $array['826'] = array('--Please Select--', 'yada', 'yada', 'yada', 'South Yorkshire') When the customer picks United Kingdom (826) as the country, javascript loads the county/state selector with the appropriate list. But still South Yorkshire is at the bottom. The list is still in the order of table inserts. By adding the ORDER BY clause, we are asking for the list to be sorted by the name of the country first, then for each country, the name of the county. That means East Yorkshire, North Yorkshire, South Yorkshire, and West Yorkshire, will be correctly listed in the now alphabetical list. Quote Link to comment Share on other sites More sharing options...
hebcat Posted November 27, 2012 Author Share Posted November 27, 2012 Hi bsmither -- only just got to seeing your suggestion now (thought I was subscribed to the thread, but wasn't) -- so, sorry for the delay in answering! Yes it works! The counties get listed alphabetically -- and even though the English/N.Irish/Scottish/Welsh counties are now all jumbled up -- at least people using the site know where to find their county in the list. Thanks so much -- you're a star!Here's a screenshot of what it looks like now, for anyone else looking to make this change Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.