Support Forums

Adding Provinces and States by country

This is a discussion on Adding Provinces and States by country within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Would anyone know if there is any way I can add Canadian Provinces and US States in the Admin Edit ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 01-09-2009, 09:19 PM   #1
Member
 
Join Date: Dec 2008
Posts: 34
Rep Power: 12
cflo is on a distinguished road
Default Adding Provinces and States by country

Would anyone know if there is any way I can add Canadian Provinces and US States in the Admin Edit States menu without them all mixing up alphabetically?

See attached screen cap, the US and Provinces are all mixed up.

I simply want to show both US and Canadian in order by country.
Like this: http://www.thefixor.com/help/StateProv.html

Any help would be much appreciated!
Attached Images
File Type: png Picture 5.png (44.2 KB, 7 views)
__________________
Developer v4.0.9

Last edited by cflo; 01-09-2009 at 10:42 PM.
cflo is offline   Reply With Quote
Old 01-09-2009, 09:27 PM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Hmm, interesting question. They are words and sorted alphabetically so without adding a bunch of code to allow them to be manually given a weight via an additional field to alter their order the only thing I can think of off the top of my head would be to prepend the state and/or province with a country abbreviation.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 01-09-2009, 09:40 PM   #3
Member
 
Join Date: Dec 2008
Posts: 34
Rep Power: 12
cflo is on a distinguished road
Default

I tried adding USA or CAN and it didn't work, they are sorted alphabetically every-time when I try to add states to the menu. You have a point weight would be a good solution but unfortunately it does not exist in the admin section. Thank you.

Quote:
Originally Posted by Lhotch
Hmm, interesting question. They are words and sorted alphabetically so without adding a bunch of code to allow them to be manually given a weight via an additional field to alter their order the only thing I can think of off the top of my head would be to prepend the state and/or province with a country abbreviation.
__________________
Developer v4.0.9
cflo is offline   Reply With Quote
Old 01-09-2009, 09:43 PM   #4
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

did you add USA and CAN to the abbreviation field or full name field? Off the top of my head I dont know which is uses to sort the output, but if you only tried adding it to one (ie abbreviation) then try adding USA and/or CAN to the full name and see if that alters the output.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 01-09-2009, 09:44 PM   #5
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Perhaps I'm either misunderstanding you or you're misunderstanding Larry's suggestion.
Quote:
prepend the state and/or province with a country abbreviation
So did you add USA-Alabama, USA-Arkansas...
CAN-Quebec...

or did you just add two new entries, CAN & USA?

-- Added edit --
It's sorted by the name

-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out

Last edited by Mike-N-Tosh; 01-09-2009 at 09:48 PM.
Mike-N-Tosh is offline   Reply With Quote
Old 01-09-2009, 09:47 PM   #6
Member
 
Join Date: Dec 2008
Posts: 34
Rep Power: 12
cflo is on a distinguished road
Default

I simply did this for USA states:
Edit States
-------------
State > [Alabama]
State Abbreviation [USA]

And this for Provinces:

State > [Alberta]
State Abbreviation [CAN]

If I add USA or CAN in front of the state it will look silly.
See attachment.

Any other options?



Quote:
Originally Posted by Mike-N-Tosh
Perhaps I'm either misunderstanding you or you're misunderstanding Larry's suggestion.

So did you add USA-Alabama, USA-Arkansas...
CAN-Quebec...

or did you just add two new entries, CAN & USA?

-Mike
Attached Images
File Type: png Picture 6.png (48.5 KB, 6 views)
__________________
Developer v4.0.9

Last edited by cflo; 01-09-2009 at 09:52 PM.
cflo is offline   Reply With Quote
Old 01-09-2009, 09:51 PM   #7
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Since you have the developer version, you could actually modify the sort in the getStates function in the Users.php file. add the abbrev ASC before the existing name ASC.

-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 01-09-2009, 09:54 PM   #8
Member
 
Join Date: Dec 2008
Posts: 34
Rep Power: 12
cflo is on a distinguished road
Default

Im sorry where is this file located?
I did a search and my PC found multiple files of that name.

Also what line would this be found under and how would I modify?

Quote:
Originally Posted by Mike-N-Tosh
Since you have the developer version, you could actually modify the sort in the getStates function in the Users.php file. add the abbrev ASC before the existing name ASC.

-Mike
__________________
Developer v4.0.9
cflo is offline   Reply With Quote
Old 01-09-2009, 09:57 PM   #9
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I guess actually the proper syntax would be "ORDER BY abbrev, name ASC"

I think that should do it.

-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 01-09-2009, 09:58 PM   #10
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

yoursite/includes/classes/kernel/Users.php
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
If I only have 1 country can a user select states? gstar Pre Sales Questions 5 09-11-2008 07:51 AM
Replace Country name by Country Code hel68c Modules / Plugins / Modifications 7 09-10-2008 08:56 PM
edit states and country ymac Technical Support 3 02-29-2008 04:04 PM


All times are GMT -4. The time now is 11:35 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0