close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

make 9 digit zip code into 5 digits so USPS can calculate shipping cost

Thread began 6/20/2016 11:16 am by bpitcher32 | Last modified 6/20/2016 11:55 am by Ray Borduin | 1685 views | 2 replies |

bpitcher32

make 9 digit zip code into 5 digits so USPS can calculate shipping cost

My checkout.php page only allows 5 digit zip codes because when a 9 digit zip is entered (xxxxx-xxxx) USPS will not calculate a shipping rate and no shipping cost is calculated at checkout, thereby providing free shipping when none is offered. Code from the checkout.php:
<div class="lineGroup">
<div class="fullColumnGroup">
<label for="Postal_Code_2" class="sublabel" >Postal Code:<span class="requiredIndicator">&nbsp;*</span></label>
<input id="Postal_Code_2" name="Postal_Code_2" type="text" value="<?php echo(WA_coalesce(array(WA_getSavedFormValue("CheckoutWizard_Sharp_Default","Postal_Code_2"),(isset($_GET["invalid"])?ValidatedField("confirm2cart","Postal_Code_2"):"")))); ?>" class="formTextfield_Large" tabindex="22" title="enter 5 digit USA zipcode." required="true" pattern="(\d{5})">
</div>
</div>
This code works for US zip codes but International postal codes with more than 5 digits are not processed and those orders cannot be completed.Is there a way to adjust the WA_eCart_USPS_PHP.php file to accept and process 9 digit zip codes? If not how do I allow 9 digit zip codes on checkout.php but only pass the first 5 digits to USPS?

Sign in to reply to this post

Ray BorduinWebAssist

The latest version of eCart has an updated WA_eCart_USPS_PHP.php file that will only use the first 5 digits of the zip when the order is from the US. I've attached the update you can use.

Attached Files
WA_eCart_USPS_PHP.php
Sign in to reply to this post
Did this help? Tips are appreciated...

bpitcher32

Thanks Ray. The new file works great!!

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...