Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * - - 1 votes

[Contribution] - USPS Methods


1245 replies to this topic

#1241 kepa

  • Community Member
  • 198 posts
  • Real Name:kepa

Posted 10 April 2012, 18:01

Hallelujah! Thanks to stumbling on post #1233 above, I finally got the damned First Class option to not only display properly but also follow through the checkout successfully. I run a heavily modded site, 2.2 and what seems like a million shipping options! (most of which are just outdated, unused and halfassed uninstalled, if you know what I mean....when you get something to work miraculously, you just want to back away from the code -- very slowly).

The key was the code for First-Class Package Service. Seemed like other threads pointing out the 'service' vs 'package' vs 'parcel' yada yada were misleading or not compatible, or just wacked.

Anyhows, here was my issues with 6.1 hopefully to save some other person hours of grief. I installed 6.1 (didn't bother with a) successfully, but the First Class rate was appearing, but without the title. The rate would appear, but when clicked to checkout, it would default back to the top option, whether it be Express Mail or Priority or whatever and customers would get charged for that service unknowingly. After struggling with the freakin' USPS naming conventions on my own, I stumbled on #1233 above, copied the piece into the usps.php from 6.1b (not a AND overwrote the one from 6.0), and it all works now. The rates are shown, correct, and when selected follows through the checkout process perfectly.

...what a nightmare for something so simple...
USPS United States Postal Service (1 pkg, 0.47 lbs total) (First-Class Package Service
---Delivery Confirmation
---Approximate delivery time from mailing date 1 day)
$4.33 [select]
USPS United States Postal Service (1 pkg, 0.47 lbs total) (Priority Mail®
---Delivery Confirmation
---Approximate delivery time from mailing date 1 day) $6.75 [select]
USPS United States Postal Service (1 pkg, 0.47 lbs total) (Parcel Post®
---Delivery Confirmation
---Approximate delivery time from mailing date 2 days) $7.90 [select]
USPS United States Postal Service (1 pkg, 0.47 lbs total) (Express Mail®
---Approximate delivery time from mailing date 1 day) $14.35 [select]

Edited by kepa, 10 April 2012, 18:04.


#1242 graveyardrecords

  • Community Member
  • 2 posts
  • Real Name:jeff

Posted 13 April 2012, 01:21

I just installed v 6.1a and now I'm receiving this error on /checkout_phpshipping.php

-2147219101 missing value for service.

any ideas? google is being retarded for information on this error :(

currently using:
OS 2.2 RC2a
5.2.17 php

Edited by graveyardrecords, 13 April 2012, 01:23.


#1243 kepa

  • Community Member
  • 198 posts
  • Real Name:kepa

Posted 13 April 2012, 17:03

I did too at first, then I replaced it with one of the other usps.php modules and it worked. Can't say why it worked or why it didn't work before, but I would try that and see what happens. 6.1b may be good, or even that code from above pasted into your usps.php from 6.1a may fix something. Yes, it is quite frustrating to say the least because when I got it at first, I never figure out the issue, so just installed another one, filled it out in admin, and it worked.

#1244 NovemberDirge

  • Community Member
  • 45 posts
  • Real Name:Chris L.

Posted 25 April 2012, 00:07

Thanks for the contribution. I'm having a little difficulty on the "if" insertion section.

My modules.php file is:
-------------------
if (tep_not_null($action)) {
switch ($action) {
// {{ buySAFE Module
case 'buysafe_save':
-------------------

This code, as included in the contribution, does not exist in my modules.php file

-------------------
if (tep_not_null($action)) {
switch ($action) {
case 'save':
while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
-------------------

Can anyone help with this? Am I using a too-old OSC version for this contribution or...

I'm using OSC V2.2 RC2

#1245 dtaquarium

  • Community Member
  • 48 posts
  • Real Name:tom

Posted 28 April 2012, 13:18

Hi
I installed usps 6.1 and seems to work fine.. in checkout i see the quote for first class mail .. but the words "first class mail" arent showing up..
anyone know how to fix it so it showes.

Thanks

#1246 geomilli

  • Community Member
  • 31 posts
  • Real Name:George Milligan
  • Gender:Male
  • Location:Danbury, Connecticut USA

Posted 16 May 2012, 06:54

As with everything here, example and explanation isn't clear enough to get the results we need... so here is my attempt at clarifying what is needed to be done to update the shipping arrays in usps.php.

In the contribution for USPS Methods 6.1, you should have a PHP page installed that retrieves an updated array from the USPS server.

Type into the address bar "your host... /catalog/admin/USPS_methods_utility.php"

The page will display the array that ...catalog/includes/modules/shipping/usps.php needs to be updated with.

Below is just a snippet of the results you should see, do not use it. Run the USPS_methods_utility.php yourself, because most likely this array is likely to change.

Quote

Utility to get all USPS shipping methods
Copy the following two statements and paste them into function usps in the catalog/includes/modules/shipping/usps.php file overwriting the existing statements that set these variables. Remove the USPS module in admin and then reinstall it in order to make use of the new methods.
	$this->types = array(
	  'Express Mail' => 'Express Mail<sup>&reg;</sup>',
	  'Express Mail Hold For Pickup' => 'Express Mail<sup>&reg;</sup> Hold For Pickup',
	  'Express Mail Flat Rate Boxes' => 'Express Mail<sup>&reg;</sup> Flat Rate Boxes',
	  'Express Mail Flat Rate Boxes Hold For Pickup' => 'Express Mail<sup>&reg;</sup> Flat Rate Boxes Hold For Pickup',

Open usps.php and replace the code completely with the updated array from the request.

Uninstall USPS from your admin panel and then reinstall it. Unfortunately, you will have to redo all of your settings... but it should be accurate and complete.

Edited by geomilli, 16 May 2012, 06:56.