Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?


Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site

 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 postal code (zip) capitals
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic   

quantum503
Advanced Member

United Kingdom
219 Posts

Posted - 09/14/2021 :  09:13:25  
Hi

In the UK Zip codes are post codes and the letters used in them should be uppercase. I'm finding that there are a few instances where they are coming through as lowercase which is affecting other processes further down the line.

I'm using PHP v7.2.3 and have the code . strtoupper($destZip) inserted into inccart.php. I have also added classes to the style thus:
<style>
.cdformzip {
text-transform: uppercase;
}
#zip {
text-transform: uppercase;
}
</style>

I am unable to replicate this myself as lowercase is automatically converted as I enter it.

Have I missed something else - such as a mobile class?

All suggestions greatly appreciated.

Eric

quadrant
Ecommerce Template Guru

United Kingdom
1014 Posts

Posted - 09/14/2021 :  09:33:39  
Hi Eric,

With the 'few instances' is there something common with the orders such as using PayPal Express where the customer doesn't fill their address in?

Regards,
David

quantum503
Advanced Member

United Kingdom
219 Posts

Posted - 09/14/2021 :  12:37:57  
Hi David

Thanks for your reply. Most are PayPal but of the dozen or so that I've looked at two are credit card transactions. Now that you mention it, I remember that Paypal can bypass the address fields, but that still leaves the other two.

Do you think that there is a way to format that field in the confirmation email since that is what we are using to parse the transaction details into the order processing system where it needs to be formatted correctly?

Eric

quadrant
Ecommerce Template Guru

United Kingdom
1014 Posts

Posted - 09/14/2021 :  22:39:11  
Hi Eric,

If it's the confirmation email then you could try looking in incemail.php at the getemailrecpt function.

Around line 80 try changing:
$recpt.=$rs['ordZip'] . '<br />';
to
$recpt.= strtoupper($rs['ordZip']) . '<br />';

If you also use a different shipping address in cart you might need to change ordShipZip too.

I've not tested the above but we do something similar with the product name and of course it will get overwritten when you next update.

Regards,
David

quantum503
Advanced Member

United Kingdom
219 Posts

Posted - 09/14/2021 :  22:45:54  
Thanks David

I'll try that and see how it goes.

Eric

Vince
Administrator

40443 Posts

Posted - 09/15/2021 :  02:07:26  
I've had a good Google on the subject and can't find a country that uses Postal Codes that wouldn't have the letters in upper case. So, I've made some changes in the v7.4 updater so that all zips are forced to upper case when saved with the order details.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

1818charlie
ECT Moderator

United Kingdom
829 Posts

Posted - 09/15/2021 :  03:44:47  
Many moons ago, 35+ years , a lawyer advised me about this subject &, if I recall correctly, the capitalisation is down to legalities as a Postal Code, or should that be POSTAL CODE forms part of an address.

When a council, government, bank etc sends you a letter your full name & address must be in capital letters in 99% of cases. A document is deemed as not served or invalid if not addressed correctly (capitalised) or spelling errors.

It dare say matters get complicated so I'll exit stage left

Steve
Bolton Lancashire

quadrant
Ecommerce Template Guru

United Kingdom
1014 Posts

Posted - 09/15/2021 :  04:45:58  
Hi Vince,

That will be a great time saver so thanks for making the changes.

We use a postcode lookup during checkout so not a big issue when that's used but the number of PayPal Express orders or manually entered addresses we get where we have to amend is staggering.

Regards,
David

quantum503
Advanced Member

United Kingdom
219 Posts

Posted - 09/15/2021 :  05:19:38  
Thanks guys

That's great. Excellent support as usual.

Eric
   Topic   
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2020 ecommercetemplates.com
This page was generated in 0.02 seconds. Snitz Forums 2000