ah... nm I see where I was confused. zone_code has the value. That worked for USA packages. a few kinks to iron out in the international half. but looks promising! :)
ah... nm I see where I was confused. zone_code has the value. That worked for USA packages. a few kinks to iron out in the international half. but looks promising! :)
Templates: Silverfish | Blue Admin | TruBlu
Contribs: USPS AutoFill | Column Divider Pro | Tabbed Products Pro | Main Image Replacer
DoNaTiOnS WeLcOmE!
I used ($order_check->fields['zone_code']) and the state dropdown fills up all fine. Again for international provinces the worst case is to put all of them in a PHP array. Congrats to your upcoming version!
OK i got it!
I had to add some logic to the queries, as your setup would only work if they were from USA. So now I do a Country query first. If they are from USA, I run the query with the state/zone_code, if not, I run the old query since there would be no matching zone for a province (which is what the state field becomes if you are from another country).
I added the GetCountry function as a PHP function now, I had to make an array of all the countries, which is how I had to do the old javascript one anyway (i just copied the html source and split on the html code snippet delimiters )
I suppose I could add the GetState as a php function and save myself from having the logic on the queries, but I don't know that either way really matters more than the other. As long as it works, and it works good :)
I've got it working with all countries now, and I've rewritten a bit of the code. I'm going to look at adding APO address support if its easy enough and I hope to have a new version within the week.
Thanks again lnksys for your help and for all those who help test it and enjoy it.
:)
Last edited by qhome; 12 Apr 2007 at 12:46 AM.
Templates: Silverfish | Blue Admin | TruBlu
Contribs: USPS AutoFill | Column Divider Pro | Tabbed Products Pro | Main Image Replacer
DoNaTiOnS WeLcOmE!
Templates: Silverfish | Blue Admin | TruBlu
Contribs: USPS AutoFill | Column Divider Pro | Tabbed Products Pro | Main Image Replacer
DoNaTiOnS WeLcOmE!
Templates: Silverfish | Blue Admin | TruBlu
Contribs: USPS AutoFill | Column Divider Pro | Tabbed Products Pro | Main Image Replacer
DoNaTiOnS WeLcOmE!
Templates: Silverfish | Blue Admin | TruBlu
Contribs: USPS AutoFill | Column Divider Pro | Tabbed Products Pro | Main Image Replacer
DoNaTiOnS WeLcOmE!
NEW VERSION 1.0 !!!
Updates:
If upgrading from v0.4, you only need to copy the
admin/includes/modules/usps_autofill_button.php
thats the only changed file since v0.4.
- Firefox (and other browsers) now supported! Thanks to zen-cart member linksys for helping me set the code up in a more proper way with native html instead of putting it all as javascript, the contrib works with all browsers now.
- Added feature to use the order_id as the usps reference number field for the order. It will auto-populate now (no config changes)
- Rewrote/Cleaned up code to check the logic before running unnecessary functions (total_weight function won’t run if using fixed weight, subtotal query won’t run unless using the value for declaration/insurance. Removed some excess javascript code now that much of it is done with server-side php
- Attempted to cleanup the readme file to make it easier to read/understand.
Thanks to linksys' tips, I realize now that I could have been using HTML for the form the whole time and use javascript for submitting the form. So thats what I did, thus making it super compatible with most browsers. I've tested it with quite a few more browsers now as well.
Enjoy and let me know if you have any problems.
(Note that v1.0 is for zc 1.3.7 only)
I've attached a copy here until the download page approves the new version.
Last edited by qhome; 9 Apr 2008 at 03:37 AM.
Templates: Silverfish | Blue Admin | TruBlu
Contribs: USPS AutoFill | Column Divider Pro | Tabbed Products Pro | Main Image Replacer
DoNaTiOnS WeLcOmE!
Bookmarks