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,983

Results 121 to 140 of 827
30 Mar 2007, 05:27
#121
motti avatar

motti

Zen Follower

Join Date:
Feb 2007
Location:
Los Angeles
Posts:
348
Plugin Contributions:
0

usps.com Click-n-ship AutoFill Button Contrib

Hello again

i am a new to web coding and such, can some one please give me ( mayby to other too) a instruction for dummy how to set the usps uspscom_clicknship_autofill_button_v0.3.zip , i download it , and read the instruction

  1. i got no file that say oreders.php i got oreder.php, is that same?
    also looking for that line
    <td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">
    i can't find the excat one, will be nice if some one put a line number the closer one i got are <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0"> on line 1197 is that the right one?

just cose i am not a pro , i like to make sure i got the right info

thank you all for your input :thumbsup:

30 Mar 2007, 21:14
#122
qhome avatar

qhome

Totally Zenned

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

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

I will try to put line numbers. Originally it was written for 1.3.5 and when they make updates code can change a bit.

But you should have a file called admin/orders.php.

I am going to upload a new 1.3.7 version later on today. Then you don't need to worry about editing the file, just copy the new one over.

31 Mar 2007, 18:04
#123
motti avatar

motti

Zen Follower

Join Date:
Feb 2007
Location:
Los Angeles
Posts:
348
Plugin Contributions:
0

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

qhome:

I will try to put line numbers. Originally it was written for 1.3.5 and when they make updates code can change a bit.

But you should have a file called admin/orders.php.

I am going to upload a new 1.3.7 version later on today. Then you don't need to worry about editing the file, just copy the new one over.

Wowww that will be great

you and other on some other issue are realy helpfull

i thank you

:smile:

03 Apr 2007, 03:32
#124
qhome avatar

qhome

Totally Zenned

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

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

tmdelia:

Can this module be modified to send the subtotal of the order to the Insurance Option as a value?

Also, I see the option to set a default value for international orders, but is there anyway to just call it from the subtotal, like I'm requesting above, since the values are usually different?

Great mod, thanks!

Ok I've added both of these to the next version. I will try to get it out tomorrow.

03 Apr 2007, 16:34
#125
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
v0.4

  • Added some code checks.
  • Added auto-escaping apostrophes in Return Address Names/Company Names
  • Added ability to set default insurance to ‘subtotal’
  • Added ability to set default declaration for international packages to ‘subtotal’
  • Fixed the attribute weight not being part of the total weight calculation. This was done by modifying the class file at the customer order level.
  • Cleaned up Readme a bit

NOTE 1: ALL files have changed, please be sure to upload them all or make manual changes to your existing admin/orders.php file.

NOTE 2: There were database changes. You will need to install the sql file again and it will clear any previous settings you had.

Enjoy and let me know if you have any problems. I will upload it to the downloads area but for now:

03 Apr 2007, 16:53
#126
qhome avatar

qhome

Totally Zenned

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

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

Also should note that the Total_weight thing will work for orders starting after you install it, as it uses the weight at the time of order placing. I still have not managed to get the post-order calculation correct so this method will have to suffice for now

04 Apr 2007, 23:49
#127
lichen avatar

lichen

New Zenner

Join Date:
Jul 2006
Posts:
4
Plugin Contributions:
0

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

Thank you for this contrib.

I am seeeing two issues, which hopefully are just minor things:

  1. The Full Name of the Return Address is not carrying over to the usps form. When I looked at the usps_autofill_button.php file, I noticed that there are two nearly identical lines referencing FullName:

document.write('<input type="hidden" name="returnFullName" value="<?php echo addslashes(USPS_RETURN_FULLNAME); ?>" id="returnFullName">')

document.write('<input type="hidden" name="returnCompanyName" value="<?php echo addslashes(USPS_RETURN_COMPANY_NAME); ?>" id="returnFullName">')

and I am supposing that I need to experiment with these values a bit.

  1. The application does what it sets out to do via Opera, but I have discovered that the Order Details page is affected in a negative way. After the shipping country, the screen displays this:

United States rm" id="labelInformationForm">') document.write('') document.write('') document.write('') document.write('') document.write('') document.write('') document.write('') document.write('') document.write('') document.write('') document.write('') document.write('<input type="hidden" name="returnFullName" value="

In Safari and Firefox, the screen fills up completely with states, countries, and more output.

...I'm wondering if others have seen this with this newest version?

Thanks,
lichen

05 Apr 2007, 00:50
#128
qhome avatar

qhome

Totally Zenned

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

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

lichen:

Thank you for this contrib.

I am seeeing two issues, which hopefully are just minor things:

  1. The Full Name of the Return Address is not carrying over to the usps form. When I looked at the usps_autofill_button.php file, I noticed that there are two nearly identical lines referencing FullName:

and I am supposing that I need to experiment with these values a bit.

Not sure I understand what you mean. One is full name, one is company name. Both can be setup in the usps configuration area. Both are working fine for me. Remember you have to set these up in the usps configuration area (as the readme file states).

lichen:

  1. The application does what it sets out to do via Opera, but I have discovered that the Order Details page is affected in a negative way. After the shipping country, the screen displays this:

In Safari and Firefox, the screen fills up completely with states, countries, and more output.

...I'm wondering if others have seen this with this newest version?

Where are you seeing that order detail stuff? it should load in its own window and the zen-cart order details page shouldn't change at all. Also note at the top of the readme file that Firefox is NOT supported. I'm not even sure how you get it to fill up with anything, as it just throws a javascript error for me.

It works fine however in IE6/7 and Opera.

05 Apr 2007, 02:17
#129
lichen avatar

lichen

New Zenner

Join Date:
Jul 2006
Posts:
4
Plugin Contributions:
0

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

qhome:

Not sure I understand what you mean. One is full name, one is company name. Both can be setup in the usps configuration area. Both are working fine for me. Remember you have to set these up in the usps configuration area (as the readme file states).

Hello,

Yes, I did set the various details (company name, return address, etc) up in the configuration area (Configuration --> USPS Auto-Fill Config.) .. BUT after your reply I re-checked and realized that I left the Full Name field blank intentionally because the shop I am dealing with doesn't use a person's name as part of their return address. When I clicked on the auto-fill, The USPS showed an error message, since Full Name is apparently a required field. Since Company is not, I will go ahead and put the Company Name in the Full Name field, and leave the Company Name Field blank. Seems an easy enough workaround.

Where are you seeing that order detail stuff? it should load in its own window and the zen-cart order details page shouldn't change at all. Also note at the top of the readme file that Firefox is NOT supported. I'm not even sure how you get it to fill up with anything, as it just throws a javascript error for me.

It works fine however in IE6/7 and Opera.

You are correct that the actual contrib does work in Opera, just as you state, and not in Firefox or Safari.

What I am describing is what I see when I try to actually view the order details from within the admin control panel of ZenCart. It seems that the word "States" in United States at the end of the Shipping Address has something to do with the results I am seeing, which are different whether I look at the order details in Opera (where they are exactly as I posted) or whether I look in Firefox or Safari (where the output fills the screen with state names and country names and then finishes with the output I quoted.

One more thing:

The setup file said there would be 16 fields to customize in the USPS config area. I have 17. Two are address lines (Address line 1 and Address line 2). Is that correct?

Thank you,
lichen

05 Apr 2007, 03:17
#130
qhome avatar

qhome

Totally Zenned

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

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

Ya sry. I added the last line at the last second to add the insurance value. I've checked the order details in FF, Opera, IE and they all look the same to me. Right after the word States should only be the button that says "USPS Auto-fill". Maybe it's a Macintosh thing?

05 Apr 2007, 06:59
#131
lichen avatar

lichen

New Zenner

Join Date:
Jul 2006
Posts:
4
Plugin Contributions:
0

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

No problem.

It's working at the moment! Previously loaded orders are still wacky, but the test order I just put in is displaying a fully formed order details page.

Again, thank you for this contrib.

My best,
lichen

06 Apr 2007, 00:27
#132
tcustomgolf avatar

tcustomgolf

Inactive

Join Date:
Dec 2005
Location:
NY
Posts:
162
Plugin Contributions:
0

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

qhome...thanks again for this time saving mod, and for adding the support for the backslash, which I truly need in my co. name.

Was wondering, if programtically possible, to add a USPS account name/ID and password to the mod configuration, then when after clicking the auto-fill button, all is filled in and you're already logged in, rather than waiting until selecting a shipping method, then having to log in. Those w/o USPS accounts can leave the config items for ID and PW blank, and it would perform as normal.

Just a thought to save a couple of steps, again, don't know the workings of the API to perform it...

Thanks again....

07 Apr 2007, 14:54
#133
qhome avatar

qhome

Totally Zenned

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

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

tcustomgolf:

qhome...thanks again for this time saving mod, and for adding the support for the backslash, which I truly need in my co. name.

Was wondering, if programtically possible, to add a USPS account name/ID and password to the mod configuration, then when after clicking the auto-fill button, all is filled in and you're already logged in, rather than waiting until selecting a shipping method, then having to log in. Those w/o USPS accounts can leave the config items for ID and PW blank, and it would perform as normal.

Just a thought to save a couple of steps, again, don't know the workings of the API to perform it...

Thanks again....

Unfortunately no. I can only manipulate the initial form page, which is basically a hack of making the usps.com site think you entered bad information on their page and forces it to reload with all your correct data pre-filled. After that you are on the actual usps.com server and my javascript that comes from the contrib has no other control on any other pages. So I can only do it to that one page. Unless we all beg USPS to put everything on one page.

11 Apr 2007, 05:16
#134
linksys avatar

linksys

New Zenner

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

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

Thanks for this great module. I managed to make it work in Firefox. Here is what I did:

In usps_autofill_button.php, move all the "document.write" statements except the last submit() out of ParseIt() function to the end of the file. Then change all these "document.write" lines to direct HTML code, i.e., remove "document.write". After this everything works under FF.:cool:

11 Apr 2007, 05:55
#135
linksys avatar

linksys

New Zenner

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

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

Another change: querying the state abbreviation from database instead of looking up in javascript on client site. This is necessary for the Firefox change above since the form is generated by PHP code instead of javascript code:

Change the SQL to:

$order_check = $db->Execute("select customers_telephone, customers_email_address, delivery_name,
delivery_company, delivery_street_address, delivery_suburb,
delivery_city, delivery_postcode, zone_code, delivery_country,
last_modified
from " . TABLE_ORDERS . ', ' . TABLE_ZONES ."
where orders_id = '" . (int)$oID . "' and zone_name = delivery_state");

11 Apr 2007, 10:36
#136
qhome avatar

qhome

Totally Zenned

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

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

Sounds great linksys! I will try this today. Thanks a lot! :tup:

11 Apr 2007, 12:54
#137
qhome avatar

qhome

Totally Zenned

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

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

Hey Linksys,

What did you use for + sCountry +, as that was javascript based.

11 Apr 2007, 14:11
#138
linksys avatar

linksys

New Zenner

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

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

For that I just hardcoded value "1" (US) as our store is for US only. Can't think of a better way but the worst case is to define all countries into an array in PHP. :P I didn't check the zencart db schema but maybe countries are saved in a db table as well like states?

qhome:

Hey Linksys,

What did you use for + sCountry +, as that was javascript based.

11 Apr 2007, 15:33
#139
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:

For that I just hardcoded value "1" (US) as our store is for US only.

:P Heh i was afraid you'd say that

linksys:

Can't think of a better way but the worst case is to define all countries into an array in PHP. :P I didn't check the zencart db schema but maybe countries are saved in a db table as well like states?

Yea, well that's what I had to do for the javascript version so I guess i'll have to do the same in php instead of jscript.

11 Apr 2007, 20:12
#140
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 sorta got it working for PHP now. I've quickly converted the functions from jscript to php syntax. The country is partially working. But I'm not getting the state to work tho. I think zone_code returns the Abbrev state (i.e. IL, GA, NY, etc) but my old code was checking the abbreviations against the number value of the usps form. So IL was value="13" which i cross referenced against the zen-cart state. Is the state currently filling in for you properly each time?

for the state value are you using:
($order_check->fields['zone_code']);
or
($order_check->fields['delivery_state']);

? or something else?