Zen Cart Logo
Forums / Addon Shipping Modules / usps.com Click-n-ship AutoFill Button Contrib

usps.com Click-n-ship AutoFill Button Contrib

Views: 224,988

Results 141 to 160 of 827
11 Apr 2007, 20:20
#141
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

usps.com Click-n-ship AutoFill Button Contrib

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! :)

11 Apr 2007, 22:20
#142
linksys avatar

linksys

New Zenner

Join Date:
Nov 2006
Posts:
30
Plugin Contributions:
0

Re: usps.com Click-n-ship AutoFill Button Contrib

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!

11 Apr 2007, 22:57
#143
jijizworld_com avatar

jijizworld_com

New Zenner

Join Date:
Apr 2007
Posts:
14
Plugin Contributions:
0

Re: usps.com Click-n-ship AutoFill Button Contrib

I would really like to have htis otion put on my site. if you can tellme exactly how to do it. I went to the admins/orders.php and i dont see anywhere to load or paste. HELP!! My site designers have no idea how to do this.

qhome:

USPS.com Click-N-Ship Auto-Fill for Zen-Cart
Version: v0.1
Date: 12-Sep-2006
Designed for: Zen Cart v1.3.x (may also work on 1.2.x)

This contrib adds a simple, yet highly advanced javscript button to your Admin->Orders page that can automatically take the Shipping Address of that customer and pre-fill the Click-N-Ship form at www.usps.com. A few other people have made previous attempts at this and have failed. This one, however, is working perfectly.

Unlike some other attempts at this, you do not have to be initially logged into your usps.com account to use this. You can complete the form process and the usps.com website will keep the label when it asks you to log in.

This contrib is also completely modular. There is only a one-line change to the
admin/orders.php file to require the module file. And it works with both Domestic and International, Everytime!

Works on all major browsers.

let me know if you have any problems.

Enjoy!

11 Apr 2007, 23:42
#144
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: usps.com Click-n-ship AutoFill Button Contrib

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 :P)

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.

:)

11 Apr 2007, 23:43
#145
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: usps.com Click-n-ship AutoFill Button Contrib

jijizworld.com:

I would really like to have htis otion put on my site. if you can tellme exactly how to do it. I went to the admins/orders.php and i dont see anywhere to load or paste. HELP!! My site designers have no idea how to do this.

If you don't have any modifications to your existing orders.php file, then just rename it and upload the one I included. There is no need to modify unless you have your own custom changes.

12 Apr 2007, 02:15
#146
linksys avatar

linksys

New Zenner

Join Date:
Nov 2006
Posts:
30
Plugin Contributions:
0

Re: usps.com Click-n-ship AutoFill Button Contrib

That's great qhome. Thanks for your prompt work. Actually I had a little more in my change - I always fill the USPS shipping reference number with the order number - you might want to incorporate that when rewriting the code?

qhome:

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 :P)

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.

:)

12 Apr 2007, 05:53
#147
jijizworld_com avatar

jijizworld_com

New Zenner

Join Date:
Apr 2007
Posts:
14
Plugin Contributions:
0

Re: usps.com Click-n-ship AutoFill Button Contrib

i am still not understanding how to do this. Do you have a walk thru for dummies course?

qhome:

If you don't have any modifications to your existing orders.php file, then just rename it and upload the one I included. There is no need to modify unless you have your own custom changes.

12 Apr 2007, 10:47
#148
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: usps.com Click-n-ship AutoFill Button Contrib

jijizworld.com:

i am still not understanding how to do this. Do you have a walk thru for dummies course?

I thought I made the readme file pretty easy. Just upload files, and install the sql. Thats it.

12 Apr 2007, 12:55
#149
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: usps.com Click-n-ship AutoFill Button Contrib

linksys:

That's great qhome. Thanks for your prompt work. Actually I had a little more in my change - I always fill the USPS shipping reference number with the order number - you might want to incorporate that when rewriting the code?

Heh actually that was supposed to go in with v0.4 version.. i just forgot it. But yea its there now. thx

12 Apr 2007, 16:38
#150
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: usps.com Click-n-ship AutoFill Button Contrib

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.

12 Apr 2007, 20:10
#151
linksys avatar

linksys

New Zenner

Join Date:
Nov 2006
Posts:
30
Plugin Contributions:
0

Re: usps.com Click-n-ship AutoFill Button Contrib

Congratulations to v1.0! I think this is one of the most useful zencart modules, and would love to see a similar for UPS. I checked UPS's shipping source, didn't quite get it but looks like there's no single form to submit data to. For example, the address entry is using a separate page. qhome, any ideas?

12 Apr 2007, 23:41
#152
jijizworld_com avatar

jijizworld_com

New Zenner

Join Date:
Apr 2007
Posts:
14
Plugin Contributions:
0

Re: usps.com Click-n-ship AutoFill Button Contrib

uuhhhh what is a sql. I am new to this forum and i dont know anything about the php or uplaods. so please try to either send me the link and show me where to put it.

I dont know how o do this stuff at all

qhome:

I thought I made the readme file pretty easy. Just upload files, and install the sql. Thats it.

13 Apr 2007, 11:31
#153
rcrosier avatar

rcrosier

Zen Follower

Join Date:
Dec 2006
Location:
Vermont
Posts:
128
Plugin Contributions:
0

Re: usps.com Click-n-ship AutoFill Button Contrib

qhome:

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.

Hi,

I'm using an old version of this, and would like to upgrade to this, however, I'm on 1.3.6...

Is there specific code that WON'T work in 1.3.6, that can be changed to work?

Thanks.

13 Apr 2007, 12:14
#154
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: usps.com Click-n-ship AutoFill Button Contrib

rcrosier:

Hi,

I'm using an old version of this, and would like to upgrade to this, however, I'm on 1.3.6...

Is there specific code that WON'T work in 1.3.6, that can be changed to work?

Thanks.

Actually, after thinking about it, v1.0 should work with older versions of zen-cart if you use the older version of the admin/orders.php file. That was the only core zen-cart file to really change for 1.3.7. The rest of the changes that I made to my code should be transparent. Replace all other files with the v1.0, including the database stuff.

You might get a database error about adding a table that already exists. Just ignore that and you should be fine.

Let me know how that works out and maybe I'll release a dual-version for both old and new

Enjoy!

Q

13 Apr 2007, 12:20
#155
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: usps.com Click-n-ship AutoFill Button Contrib

jijizworld.com:

uuhhhh what is a sql. I am new to this forum and i dont know anything about the php or uplaods. so please try to either send me the link and show me where to put it.

I dont know how o do this stuff at all

Hi jiji,

PHP is the extension of the files that you use to run zen-cart. They are dynamic code that use a database to populate the webpage with actual tangible data.

SQL is the code that the database uses to create/update/delete database data. This contrib adds some table data to your zen-cart database to work.

I would suggest reading up on some of the zen-cart documentation to get the basics down before trying any contributions. Also google php and mysql. It will help a lot to get an understanding of how it all works as it applies to almost all website scripts these days, not just zen-cart, and it is important to understand the basics before trying to patch new stuff to your store.

13 Apr 2007, 12:23
#156
rcrosier avatar

rcrosier

Zen Follower

Join Date:
Dec 2006
Location:
Vermont
Posts:
128
Plugin Contributions:
0

Re: usps.com Click-n-ship AutoFill Button Contrib

qhome:

Actually, after thinking about it, v1.0 should work with older versions of zen-cart if you use the older version of the admin/orders.php file. That was the only core zen-cart file to really change for 1.3.7. The rest of the changes that I made to my code should be transparent. Replace all other files with the v1.0, including the database stuff.

You might get a database error about adding a table that already exists. Just ignore that and you should be fine.

Let me know how that works out and maybe I'll release a dual-version for both old and new

Enjoy!

Q

Well, actually, after I posted, I remembered that I'm ACTUALLY using it with the Super Orders contrib... which has worked pretty well, but we don't use weights for attribs. I use Firefox, so I really want to upgrade, as we need to use IE when we use USPS and this contrib (minor annoyance). I'll merge this into super orders, and see what happens, then post the results.

Thanks for the quick reply!

13 Apr 2007, 12:46
#157
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: usps.com Click-n-ship AutoFill Button Contrib

rcrosier:

Well, actually, after I posted, I remembered that I'm ACTUALLY using it with the Super Orders contrib... which has worked pretty well, but we don't use weights for attribs. I use Firefox, so I really want to upgrade, as we need to use IE when we use USPS and this contrib (minor annoyance). I'll merge this into super orders, and see what happens, then post the results.

Thanks for the quick reply!

Earlier on in this thread I released/attached a Super_Orders.php version of this file for zen-cart 1.3.6.

http://www.zen-cart.com/forum/showthread.php?t=46059&page=2

read that page for the attachment and some details about it. Back up your existing super_orders.php to be safe.

13 Apr 2007, 12:55
#158
rcrosier avatar

rcrosier

Zen Follower

Join Date:
Dec 2006
Location:
Vermont
Posts:
128
Plugin Contributions:
0

Re: usps.com Click-n-ship AutoFill Button Contrib

qhome:

Earlier on in this thread I released/attached a Super_Orders.php version of this file for zen-cart 1.3.6.

http://www.zen-cart.com/forum/showthread.php?t=46059&page=2

read that page for the attachment and some details about it. Back up your existing super_orders.php to be safe.

LOL! After I posted, I went ahead and merged the snippets into my copy here... looked like those didn't change much or at all... THEN I noticed your note here.. Oh well.

It's working great on my 1.3.6 with Super Orders!

BTW, any chance anyone could add an option for insurance where there is a choice for "total" in addition to "subtotal"? Someone once suggested to me that we should include our shipping amount in the insured amount, so we can get reimbursed for our shipping costs in the event of USPS losing a package. Does anyone else do this? (Although we only insure the expensive packages... we self-insure otherwise)

Thanks again for a great mod! (and for posting the super orders mod!)

13 Apr 2007, 15:05
#159
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

Re: usps.com Click-n-ship AutoFill Button Contrib

rcrosier:

LOL! After I posted, I went ahead and merged the snippets into my copy here... looked like those didn't change much or at all... THEN I noticed your note here.. Oh well.

It's working great on my 1.3.6 with Super Orders!

BTW, any chance anyone could add an option for insurance where there is a choice for "total" in addition to "subtotal"? Someone once suggested to me that we should include our shipping amount in the insured amount, so we can get reimbursed for our shipping costs in the event of USPS losing a package. Does anyone else do this? (Although we only insure the expensive packages... we self-insure otherwise)

Thanks again for a great mod! (and for posting the super orders mod!)
Good to hear that it works.

I will add 'total' as an option to version 1.0a.

Here is a quick patch for you or anyone else who needs it now. Just replace your existing v1.0 copy.

13 Apr 2007, 15:35
#160
rcrosier avatar

rcrosier

Zen Follower

Join Date:
Dec 2006
Location:
Vermont
Posts:
128
Plugin Contributions:
0

Re: usps.com Click-n-ship AutoFill Button Contrib

qhome:

Good to hear that it works.

I will add 'total' as an option to version 1.0a.

Here is a quick patch for you or anyone else who needs it now. Just replace your existing v1.0 copy.

Wow! That was quick.
Thanks, I'll install it, and let you know if there are any issues.