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"> *</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?