JanisL:
Thanks for the fix. I got rid of the "zip code error" by deleting this part of the script pertaining to shipping from another zip code.
<input type="hidden" name="form.shipFromAnotherZipCode" value="true" id="cShipDiffZip">
<input type="hidden" name="form.otherZipCode" value="<?php echo USPS_DELIVERY_OTHER_ZIPCODE; ?>" id="tShippingZip">
<?php } elseif (USPS_DELIVERY_SAME_ZIPCODE != 'same') { ?>
<input type="hidden" name="form.shipFromAnotherZipCode" value="true" id="cShipDiffZip">
<input type="hidden" name="form.otherZipCode" value="<?php echo USPS_DELIVERY_OTHER_ZIPCODE; ?>" id="tShippingZip">
It all works fine now, except for the aforementioned failure of the customer's email address to fill in automatically. But that's a small concern compared to having to fill the entire thing in line-by-line.
Thanks again!
Sorry if this is long but here is what I have found:
I still have major problems with going to "next page" (select shipping type) after the first page has been filled in. Auto-Fill work perfectly in Login and filling the page with data but that where it all goes wrong after clicking the next button to select type of shipping method. I keep getting errors that their system is experencing problems.... I also just tried JanisL suggestion doesent fix anything for me. I have ran many hours of test every way I can think of and still no go.
Here is what I have discovered. When you click on the USPS button zencart will fill in the Ship From address (User Profile) after Login. USPS has some way to tell where the Ship from address comes from. I have caught a java error that says:
://cns.usps.com/go/Secure/LabelInformat....form.labelId=nul&validationFailed=True#
If you let USPS pull the Ship From information from your USPS account this set the form where you can paste in all information or manually fill or pull from address book and it will process correctly.
Then on the email address I have found when Beyond Comparing Source Code that on line 1073 here is code of page that was Auto-filled in:
<div id="addressToColOne" class="column addressToColumn">
<input type="hidden" name="form.deliveryPhoneId" value="" id="deliveryPhoneId"/>
<input type="hidden" name="form.deliveryFaxId" value="" id="deliveryFaxId"/>
<input type="hidden" name="form.deliveryEmailId" value="
[email protected]" id="deliveryEmailId"/>
<input type="hidden" name="form.deliveryAddressId" value="" id="deliveryAddressId"/>
<input type="hidden" name="form.deliveryContactId" value="" id="deliveryContactId"/>
Here is the code of page manually filled in:
<div id="addressToColOne" class="column addressToColumn">
<input type="hidden" name="form.deliveryPhoneId" value="-1" id="deliveryPhoneId"/>
<input type="hidden" name="form.deliveryFaxId" value="-1" id="deliveryFaxId"/>
<input type="hidden" name="form.deliveryEmailId" value="-1" id="deliveryEmailId"/>
<input type="hidden" name="form.deliveryAddressId" value="-1" id="deliveryAddressId"/>
<input type="hidden" name="form.deliveryContactId" value="-1" id="deliveryContactId"/>
Notice manually filled in page values are set to "-1" and Auto-Fill are set to actual value.
I suggest you load in a page that was filed in by USPS auto fill and another page that has manually filed in then using Beyond Compare you will see a big difference from top to bottom.
Example of Auto Fill page this line <input type="text" name="form.deliveryLastName" maxlength="50" value="MacDonald" tabindex="0" id="tNameLastTo" class="text-input-large name-or-company"/>
Compared to same line when manually filled in: <input type="text" name="form.deliveryLastName" maxlength="50" value="" tabindex="0" id="tNameLastTo" class="text-input-large name-or-company"/>
Notice that all the values are "" on the manually filed in page and on the Auto-Filled page will have values filled in as above"MacDonald"
I found this at the bottom of page that may be what is preventing Auto-Fill.
<!-- START OF SmartSource Data Collector TAG -->
<!-- Copyright (c) 1996-2011 WebTrends Inc. All rights reserved. -->
<!-- Version: 9.3.0 -->
<!-- Tag Builder Version: 3.1 -->
<!-- Created: 3/28/2011 6:24:05 PM -->
<script src="/go/js/webtrends.js" type="text/javascript"></script>
This may also be involved taken from blank page just been logged in.
<script type="text/javascript">
dojo.require("usps.login.user");
USPS.User=new usps.login.user();
USPS.User.initialize();
var isLoggedIn = true;
USPS.User.isLoggedIn = isLoggedIn;
dojo.require("usps.utils.session");
var sessionTimer = new usps.utils.session();
sessionTimer.addSessionRefreshTimer();
USPS.User.profile = { title : "",firstName : "SHIPPING",middleInitial : "",lastName : "DEPARTMENT",suffix : "",name : "EZORB CALCIUM COM LLC",addressLine1 : "3527 HYDE PARK AVE STE 100",addressLine2 : "",addressLine3 : "",city : "MIDLAND",stateProvince : "TX",postalCode : "79707-5713",countryName : "UNITED STATES",countryISOCode : "840",urbanizationCode : "",email : "
[email protected]",phoneNumber : "",businessPhoneNumber : "4326897272",faxNumber : "4326149800"};
</script>
So it may be if there is some way to prevent USPS Auto-Fill from logging and allow USPS to login their User Profile then send order information it may work. Cause it appears they are using a complicated Script to prevent someone hacking and pasting in information so they have gone to great ex streams to prevent Auto-Fill. Sure hope I am wrong on not getting this to work.