Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

UPS Shipping destination postcode limited to 5 characters in Magento 1.3.0? 
 
bw2008
Member
 
Total Posts:  39
Joined:  2008-06-21
 

Dear Magento Team,

According to UPS, up to 9 characters for postcode is allowed.

May I know why the following change was made to limit the destination postcode to 5 characters :

Magento 1.2.1.2 (in line 211 and 512 of app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php):

'19_destPostal'  => $r->getDestPostal(),

Magento 1.3.0 (in line 211 and 512 of app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php):

'19_destPostal'  => substr($r->getDestPostal(), 05),
 
Magento Community Magento Community
Magento Community
Magento Community
 
bw2008
Member
 
Total Posts:  39
Joined:  2008-06-21
 

Hmm...still no reply on this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
aloeroot
Jr. Member
 
Total Posts:  18
Joined:  2008-07-24
 

This would seem to destroy UPS shipping functionality to Canada, since Canadian postal codes are six characters long. Is there a way to disable this new character limit?

 
Magento Community Magento Community
Magento Community
Magento Community
 
bw2008
Member
 
Total Posts:  39
Joined:  2008-06-21
 

Here’s my fix:

1. Find the following (line 147):

$r->setDestPostal($request->getDestPostcode());
and replace it with:
if ($r->getDestCountry()=='US'{
  $r
->setDestPostal(substr($request->getDestPostcode(), 05));
else {
  $r
->setDestPostal($request->getDestPostcode());
}

2. Find the following (line 211 and 512)

'19_destPostal'  => substr($r->getDestPostal(), 05),
and replace them with the following:
'19_destPostal'  => $r->getDestPostal(),
 
Magento Community Magento Community
Magento Community
Magento Community
 
skicrave
Member
 
Total Posts:  51
Joined:  2007-12-02
 

File a bug report if you haven’t already.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top