Zen Cart Logo
Forums / All Other Contributions/Addons / Proper Case Support for 1.3.x

Proper Case Support for 1.3.x

Locked

Views: 1,782

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
15 Aug 2006, 7:04 AM
#1
funkey avatar

funkey

New Zenner

Join Date:
Jul 2005
Posts:
85
Plugin Contributions:
0

Proper Case Support for 1.3.x

Hi Everyone,

Just updated the code from SpeedyG's old case sensitivity modification (http://www.zen-cart.com/forum/showthread.php?t=30300&highlight=propercase) to 1.3.x in case anyone is interested.

Tested against a vanilla 1.3.0.2.

Any comments, requests, updates should be posted here -- as the old thread is now archived.

Paul

22 Aug 2006, 10:41 PM
#2
longstockings avatar

longstockings

Zen Follower

Join Date:
Jul 2004
Posts:
198
Plugin Contributions:
0

Re: Proper Case Support for 1.3.x

When adding the propercase code to your files you need to fix a typo
Where it specifies the lastname at the end of that line in brackets it says firstname

It should say lastname

Basically the code should look like this

/****** Begin: CONVERT TO PROPERCASE /
$firstname = propercase_input($firstname, 1);
$lastname = propercase_input($lastname, 1);
$street_address = propercase_input($street_address, 0);
$suburb = propercase_input($suburb, 0);
$city = propercase_input($city, 0);
$state = propercase_input($state, 0);
$postcode = strtoupper ($postcode);
$company = propercase_input($company, 1);
/
* End: CONVERT TO PROPERCASE *******/

You will notice that I have added support for the comapny name and post code for us guys and gals in the UK

7 Sep 2006, 1:34 AM
#3
profitshock avatar

profitshock

Zen Follower

Join Date:
Jul 2004
Location:
UK
Posts:
169
Plugin Contributions:
0

Re: Proper Case Support for 1.3.x

Anyone managed to get this working for 1.3.5 yet?

7 Sep 2006, 1:45 AM
#4
funkey avatar

funkey

New Zenner

Join Date:
Jul 2005
Posts:
85
Plugin Contributions:
0

Re: Proper Case Support for 1.3.x

profitshock:

Anyone managed to get this working for 1.3.5 yet?

I'll attempt to do this today, having just installed a test version of 1.3.5 myself.

Paul

7 Sep 2006, 4:24 AM
#5
funkey avatar

funkey

New Zenner

Join Date:
Jul 2005
Posts:
85
Plugin Contributions:
0

Re: Proper Case Support for 1.3.x

The following version works with a vanilla 1.3.5 installation based on the 09042006 release.

It doesn't have any of the UK specific modifications (which i'd like to turn into country-based workarounds -- like uppercasing the country name for postal services that require it -- at some point in the future), but those are easily implemented following the reply above.

Paul

20 Nov 2006, 8:58 PM
#6
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: Proper Case Support for 1.3.x

Can anyone confirm if "ProperCase" has been updated to work with Zen Cart v.1.36 or if the latest ProperCase 1.35 version works fine with Zen Cart v.1.36?

Specifically does the latest version of ProperCase integrate well when the new state drop down code in Zen Cart v.1.36 is enabled? With the new state drop down code built into the 1.36 core, ProperCase need no longer apply to the Zones field, but rather just apply to the other data manually entered when a customer creates an account or updates their addressbook.

Woody

23 Nov 2006, 2:49 AM
#7
funkey avatar

funkey

New Zenner

Join Date:
Jul 2005
Posts:
85
Plugin Contributions:
0

Re: Proper Case Support for 1.3.x

Woodymon:

Can anyone confirm if "ProperCase" has been updated to work with Zen Cart v.1.36 or if the latest ProperCase 1.35 version works fine with Zen Cart v.1.36?

Specifically does the latest version of ProperCase integrate well when the new state drop down code in Zen Cart v.1.36 is enabled? With the new state drop down code built into the 1.36 core, ProperCase need no longer apply to the Zones field, but rather just apply to the other data manually entered when a customer creates an account or updates their addressbook.

Woody

I'll check it and let you know :)

23 Nov 2006, 3:35 AM
#8
woodymon avatar

woodymon

Totally Zenned

Join Date:
Sep 2004
Posts:
2,309
Plugin Contributions:
1

Re: Proper Case Support for 1.3.x

I manually merged into ZC 1.36, the ProperCase customizations previously suggested in this thread (see below) and everything appears to works well. I also applied the customization to the $state string. As such it appears the propercase_input function only impacts the state string when the long form of the state is manually entered. Does not appear to have any impact when the state abbreviation is called from zone definitions. I need to take a close look at the function logic to understand why, but at any rate, this is good.

If a state abbreviation is manually entered, for example when there is no zone definitions set-up for a specific country, then I suspect the manually entered abbreviation will be converted by propercase and will then not appear in all UPPERCASE as would be the desired effect (that is the propercase_input function would convert "NY" to "Ny"). Or maybe it is improper to abbreviate state addresses in most of the world and this is not an issue? In the US abbreviation of the state address is recommended.

The ProperCase functionality could possibly be updated to include a test for the number of characters entered in the state field. If the manual state entry is short (two characters, for example) then apply strtoupper. Similar idea could apply to short company names and any single character fields (e.g. if customer supplies only first initial for first name, and the store allows a single character for this field). Or maybe the propercase function logic has already been designed to adapt to such situations?

I don't think this would be an issue for country addresses since the country input/selection process always calls the country abbreviation from the zone definitions. At least this appears to be the case. No pun intended.

$firstname = propercase_input($firstname, 1);
$lastname = propercase_input($lastname, 1);
$street_address = propercase_input($street_address, 0);
$suburb = propercase_input($suburb, 0);
$city = propercase_input($city, 0);
$state = propercase_input($state, 0);
$postcode = strtoupper ($postcode);
$company = propercase_input($company, 1);

14 Jul 2008, 2:53 AM
#9
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Proper Case Support for 1.3.x

I have easy populate advanced on my site. I was actually hoping that this mod would work with it but it doesn't seem to. Is their away to get this mod to work with it?