Jump to content



Latest News: (loading..)

- - - - -

USPS Rate V4, Intl Rate V2 (official support thread)


  • Please log in to reply
482 replies to this topic

#181   mtmatthew44

mtmatthew44
  • Members
  • 2 posts
  • Real Name:Matthew Marsolek
  • Gender:Male
  • Location:Missoula, Montana

Posted 01 May 2012 - 08:30 PM

Hello Jetta,

For a novice coder like myself, can you tell me which USPS rate v4 module I should install for an osCommerce version 2.2-MS2?

I installed and followed the instructions for "USPS Rate V4 Intl Rate V2", but my edited perferences in the Shipping Module admin page wouldn't stay (after clicking "confirm"), and this link (http://www.uspsprioritymail.com/et_regcert.html) was not good when I went to check on my USPS account status.

Thank you so much!

Matthew

#182   a.forever

a.forever
  • Members
  • 199 posts
  • Real Name:Kevin
  • Gender:Male

Posted 02 May 2012 - 05:41 PM

View PostNovemberDirge, on 30 April 2012 - 05:21 PM, said:

Hey team,

Any idea on the error I'm encountering?

Thanks!

Did you follow the instructions provided in the readme.txt file? If so, you should have the following code under admin/includes/functions/general.php:
// USPS START
function tep_cfg_usps_services($select_array, $key_value, $key = '')
{
$key_values = explode( ", ", $key_value);
$name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
$string = '<b><div style="width:20px;float:left;text-align:center;">&nbsp;</div><div style="width:30px;float:left;text-align:center;">Min</div><div style="width:30px;float:left;text-align:center;">Max</div><div style="float:left;"></div><div style="width:50px;float:right;text-align:center;">Handling</div></b><div style="clear:both;"></div>';
for ($i=0; $i<sizeof($select_array); $i++)
  {
  $string .= '<div id="' . $key . $i . '">';
  $string .= '<div style="width:20px;float:left;text-align:center;">' . tep_draw_checkbox_field($name, $select_array[$i], (in_array($select_array[$i], $key_values) ? 'CHECKED' : '')) . '</div>';
  if (in_array($select_array[$i], $key_values)) next($key_values);
  $string .= '<div style="width:30px;float:left;text-align:center;">' . tep_draw_input_field($name, current($key_values), 'size="1"') . '</div>';
  next($key_values);
  $string .= '<div style="width:30px;float:left;text-align:center;">' . tep_draw_input_field($name, current($key_values), 'size="1"') . '</div>';
  next($key_values);
  $string .= '<div style="float:left;">' . preg_replace(array('/RM/', '/TM/', '/International/', '/Envelope/', '/ Mail/', '/Large/', '/Medium/', '/Small/', '/First/', '/Legal/', '/Padded/', '/Flat Rate/', '/Regional Rate/', '/Express Guaranteed /'), array('', '', 'Intl', 'Env', '', 'Lg.', 'Md.', 'Sm.', '1st', 'Leg.', 'Pad.', 'F/R', 'R/R', 'Exp Guar'), $select_array[$i]) . '</div>';
  $string .= '<div style="width:50px;float:right;text-align:center;">$' . tep_draw_input_field($name, current($key_values), 'size="2"') . '</div>';
  next($key_values);
  $string .= '<div style="clear:both;"></div></div>';
  }
return $string;
}
function tep_cfg_usps_extraservices($select_array, $key_value, $key = '')
{
$key_values = explode( ", ", $key_value);
$name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
$string = '<b><div style="width:20px;float:left;text-align:center;">N</div><div style="width:20px;float:left;text-align:center;">Y</div></b><div style="clear:both;"></div>';
for ($i=0; $i<sizeof($select_array); $i++)
  {
  $string .= tep_draw_hidden_field($name, $select_array[$i]);
  next($key_values);
  $string .= '<div id="' . $key . $i . '">';
  $string .= '<div style="width:20px;float:left;text-align:center;"><input type="checkbox" name="' . $name . '" value="N" ' . (current($key_values) == 'N' || current($key_values) == '' ? 'CHECKED' : '') . ' id="N-'.$key.$i.'" onclick="if(this.checked==1)document.getElementById(\'Y-'.$key.$i.'\').checked=false;else document.getElementById(\'Y-'.$key.$i.'\').checked=true;"></div>';
  $string .= '<div style="width:20px;float:left;text-align:center;"><input type="checkbox" name="' . $name . '" value="Y" ' . (current($key_values) == 'Y' ? 'CHECKED' : '') . ' id="Y-'.$key.$i.'" onclick="if(this.checked==1)document.getElementById(\'N-'.$key.$i.'\').checked=false;else document.getElementById(\'N-'.$key.$i.'\').checked=true;"></div>';
  next($key_values);
  $string .= preg_replace(array('/Signature/', '/without/', '/Merchandise/', '/TM/', '/RM/'), array('Sig', 'w/out', 'Merch.', '', ''), $select_array[$i]) . '<br>';
  $string .= '<div style="clear:both;"></div></div>';
  }
return $string;
}
// USPS END


#183   dewed

dewed
  • Members
  • 50 posts
  • Real Name:Duane L
  • Gender:Male
  • Location:North America

Posted 03 May 2012 - 05:40 PM

sorry I cant help.. trying to get this setup myself.. seems the site that the mod relies on is down..

Can anyone load this page ?
http://www.uspsprioritymail.com/et_regcert.html
Just call me Dewed ...

#184   vstick

vstick
  • Members
  • 4 posts
  • Real Name:crystal

Posted 04 May 2012 - 02:12 AM

I am new to osCommerce - came from Magento and I will admit it has been a struggle. I only left Magento because my provider bases their usage on size of database files and Magento is about 43M out of the box, they allow 2GB, even their pro is only 3GB. Anyway, I was hoping to use the USPS mudule included in osCommerce 2.3.1, but after struggling with and only getting Libray Shipping to work that I gave up and went to Methods. Got that to work, but my primary shipping method, First-Class Parcel, wasn't populating the description. Again, after a long hard struggle I gave up and went to USPS Rate V4 Intl Rate V2 - v.1.7_1 with USPS Restrict Methods and just now seems to be working, but to be honest not sure if I am getting full functionality.
The only way I got this to work was to use the drop on top method, I am assuming there are a number of steps missing in the step by step instructions since the step by step didn't have some of the changed files included in the instructions and I wasn't in the mood to do a file compare - I've been at osCommerce for a month trying to get it where I need/want it. Paypal is now broken. Fix one thing, breaks another...on to my next struggle.

#185   jdfitch

jdfitch
  • Members
  • 73 posts
  • Real Name:JD Fitch
  • Location:College Station, TX

Posted 04 May 2012 - 02:36 PM

This has got me  scratching my head.
Using the old  USPS module that went dark we did not have this error.
After installling the module and emailing USPS, we get  rates  for Cont.  U.S.
But,
we only offer postal service to Alaska, Hawaii, APO and FPO addresses.
When running a test I get this error:
<Package ID="1">
<Error>
<Number>-2147219401</Number>
<Source>;clsRateV4.CreateSinglePostage-CreateSinglePostage;RateEngineV4.ProcessRequest</Source>
<Description> Error Information: The Destination ZIP Code you have entered is invalid.</Description>
<HelpFile></HelpFile>
<HelpContext>1000440</HelpContext>
</Error>
</Package>
</RateV4Response>
Address is:
APO, AE 09391

This is a valid US Postal Service Zip Code.
Any thoughts?
If you choose not to decide you still have made a choice, I will choose a purpose clear, I will choose Free Will. --Neal Peart - Rush

#186   Dennisra

Dennisra
  • Members
  • 515 posts
  • Real Name:Joseph D. Jefferson
  • Gender:Male

Posted 04 May 2012 - 06:36 PM

I believe there is a forum rule about posting the same question in multiple topics.

09391 is not a valid zip code.

#187 ONLINE   kymation

kymation

    Believers

  • Community Sponsor
  • 6,761 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 04 May 2012 - 06:46 PM

The current USPS database says that 09391 is valid: it's assigned to Joint Base Balad in Iraq. Perhaps none of the services you have selected are available to that destination. You could ask the USPS what services are available.

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#188   Dennisra

Dennisra
  • Members
  • 515 posts
  • Real Name:Joseph D. Jefferson
  • Gender:Male

Posted 04 May 2012 - 06:57 PM

Try it:
https://tools.usps.com/go/ZipLookupAction!input.action (By Zip Code)
It's not valid!

#189   fulluvscents

fulluvscents
  • Members
  • 305 posts
  • Real Name:Jetta
  • Gender:Female
  • Location:Fort Wayne, Indiana

Posted 04 May 2012 - 08:36 PM

@NovemberDirge

Quote

I have yet to proceed to the application_top.php, general.php and modules.php edits

tep_cfg_usps_services()

isn't being defined because you haven't finished the installation

#190   fulluvscents

fulluvscents
  • Members
  • 305 posts
  • Real Name:Jetta
  • Gender:Female
  • Location:Fort Wayne, Indiana

Posted 04 May 2012 - 08:47 PM

@vstick

Don't use the Restrict Methods contribution.  That is an add on for use in conjunction with USPS.  It isn't the USPS mod itself.

#191   fulluvscents

fulluvscents
  • Members
  • 305 posts
  • Real Name:Jetta
  • Gender:Female
  • Location:Fort Wayne, Indiana

Posted 04 May 2012 - 08:50 PM

@jdfitch

USPS already gave you the answer:

Quote

Error Information: The Destination ZIP Code you have entered is invalid

If you believe it is a valid zip code, then contact their technical center.

#192   cmcljpp

cmcljpp
  • Members
  • 7 posts
  • Real Name:Christine

Posted 09 May 2012 - 02:04 AM

Have been trying to resolve my USPS problems for weeks.  Had USPS methods installed for years but after most recent changes first class domestic disappeared, I applied all kinds of updates and it wouldn't resolve.  So tried this contribution and all domestic finally works fine but now my international calculations are down.  I get the following error(s):  Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 84: parser error : etc.  So international rates are not showing at all now.

#193   rwest

rwest
  • Members
  • 81 posts
  • Real Name:Ron West
  • Gender:Male
  • Location:WA

Posted 12 May 2012 - 02:04 AM

I have something happening that I need help with.  My USPS shipping rates have been working great since I installed this contrib at the end of March.  Today I wanted to go into admin/module.php, and all I got was a blank page.  To make a long story short, every time I try to access modules.php from admin, it throws the following error:

PHP Fatal error:  Call to a member function getAll() on a non-object in /home5/cascadec/public_html/admin/modules.php on line 17

Line 17 is this:

$modules = $cfgModules->getAll();

I don't know why this worked when I first installed the mod, but now I can't open my modules.php, or shipping  Can anyone tell me what this line is having a problem with?  I run a 2.2 shop.

Ron West

#194   reverseholic

reverseholic
  • Members
  • 1 posts
  • Real Name:Caitlin

Posted 13 May 2012 - 07:22 AM

First I must say, Jetta I really appreciate the plugin. It, thus far, has been great.

Now for the topic of my concern....

I can't for the life of me seem to actually make any changes to the shipping meathods... Every time I check mark, set the min or max rate, or change the handing price, upon saving it loses everything. I am seening no errors in the log and the oly fireld that is filled is the min value in the 1st-Class Lg. Env. It is, for some reason filled with the value "Array" and resets to that everytime I save my settings.

If it helps in teh main shipping modules I also get the following:
Shipping Methods (Domestic and International)
Array

Extra Services (Domestic)
Array

Extra Services (International)
Array

I am lost on what to do and would appreciate your (or anyones) help.

#195   wlmorgan

wlmorgan
  • Members
  • 12 posts
  • Real Name:Walter Morgan

Posted 17 May 2012 - 12:16 PM

Thank for the contribution.

There seems to a $6.00 minimum shipping charge.

If I have a 6 oz item it's $6.05. If I have 10lb item it's $10.00.

I only have parcel post selected with no handling charge at present.

thanks

Walter

#196   wlmorgan

wlmorgan
  • Members
  • 12 posts
  • Real Name:Walter Morgan

Posted 17 May 2012 - 01:22 PM

Never mind. I'm a dope:)

Great contribution. I finally realized that individual item shipping rates can be manipulated by using the min and max weights for each shipping method.

Sweet!

#197   mtmatthew44

mtmatthew44
  • Members
  • 2 posts
  • Real Name:Matthew Marsolek
  • Gender:Male
  • Location:Missoula, Montana

Posted 03 June 2012 - 07:17 PM

Hello folks!

The USPS module is mistakenly adding weight and therefore adding shipping costs. The problem is a workshop registration with a weight set at 0.00 which doesn't require any shippng.

When when a customer checks out they end up on the checkout_shipping.php page and the module is calculating rates based on 1 oz.

The module is acting like the product has weight even though it's set to 0.00 (I've even tried setting it to a negative number).

I've tried changing my tare weight to zero and editing the minimium weights in the USPS module but the problem persists.

Is this a database or product attributes problem? I would love to hear ideas for a possible solution. What's baffling is that I have some mp3s for sale on my site with a 0.00 weight that work just fine; they successfully go right through to the payment page.

Thank you so much!

Version: USPS Rate V4 Intl Rate V2 - v.1.7

#198   sunrise99

sunrise99
  • Members
  • 181 posts
  • Real Name:David
  • Gender:Male

Posted 19 June 2012 - 01:30 AM

Hi,
Now we use osc22RC2A and your lastest USPS module.

we use Paypal Standard module.

we get this error when go to checkout:

"The link you have used to enter the PayPal system contains an incorrectly formatted item amount."

I think your Priority Mail® ,  ®  have issue, would you please help to check and give your suggestion?



Best Regards,

#199   sunrise99

sunrise99
  • Members
  • 181 posts
  • Real Name:David
  • Gender:Male

Posted 19 June 2012 - 01:49 AM

View Postsunrise99, on 19 June 2012 - 01:30 AM, said:

Hi,
Now we use osc22RC2A and your lastest USPS module.

we use Paypal Standard module.

we get this error when go to checkout:

"The link you have used to enter the PayPal system contains an incorrectly formatted item amount."

I think your Priority Mail® ,  ®  have issue, would you please help to check and give your suggestion?



Best Regards,

sorry we use PayPal IPN v2.3.4.6 now. have this issue on USPS.

#200   vlad36

vlad36
  • Members
  • 5 posts
  • Real Name:Vlad

Posted 21 June 2012 - 03:14 PM

Hi,

If any one need ability to choose Live or Test server.

File to work with is usps.php

Find:

   if ($http->Connect('production.shippingapis.com', 80))
            {
            $http->addHeader('Host', 'production.shippingapis.com');
            $http->addHeader('User-Agent', 'osCommerce');
            $http->addHeader('Connection', 'Close');
            if ($http->Get('/shippingapi.dll?' . $request)) $body = preg_replace(array('/\&lt;sup\&gt;\&amp;reg;\&lt;\/sup\&gt;/', '/\&lt;sup\&gt;\&amp;trade;\&lt;\/sup\&gt;/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '&quot;,', '&quot; ', '&quot;<br>', 'BREAK'), htmlspecialchars_decode($http->getBody()));
//            mail(STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, $body);
            $http->Disconnect();
            return json_decode(json_encode(simplexml_load_string($body)),TRUE);
            }

Replace with:

//Start Live or test server
        if (MODULE_SHIPPING_USPS_SERVER == 'Live') {

        if ($http->Connect('production.shippingapis.com', 80))
            {
            $http->addHeader('Host', 'production.shippingapis.com');
            $http->addHeader('User-Agent', 'osCommerce');
            $http->addHeader('Connection', 'Close');
            if ($http->Get('/shippingapi.dll?' . $request)) $body = preg_replace(array('/\&lt;sup\&gt;\&amp;reg;\&lt;\/sup\&gt;/', '/\&lt;sup\&gt;\&amp;trade;\&lt;\/sup\&gt;/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '&quot;,', '&quot; ', '&quot;<br>', 'BREAK'), htmlspecialchars_decode($http->getBody()));
//echo "Body = ";
//echo $body;
//echo "<br>";
            $http->Disconnect();
            return json_decode(json_encode(simplexml_load_string($body)),TRUE);
           }
         }
        if (MODULE_SHIPPING_USPS_SERVER == 'Test') {

        if ($http->Connect('testing.shippingapis.com', 80))
            {
            $http->addHeader('Host', 'testing.shippingapis.com');
            $http->addHeader('User-Agent', 'osCommerce');
            $http->addHeader('Connection', 'Close');
            if ($http->Get('/ShippingAPITest.dll?' . $request)) $body = preg_replace(array('/\&lt;sup\&gt;\&amp;reg;\&lt;\/sup\&gt;/', '/\&lt;sup\&gt;\&amp;trade;\&lt;\/sup\&gt;/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '&quot;,', '&quot; ', '&quot;<br>', 'BREAK'), htmlspecialchars_decode($http->getBody()));
//echo "Body = ";
//echo $body;
//echo "<br>";
            $http->Disconnect();
            return json_decode(json_encode(simplexml_load_string($body)),TRUE);
            }
        }
//End Live or test server

Find:

   tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Show International Regulations:', 'MODULE_SHIPPING_USPS_REGULATIONS', 'True', 'Displays international regulations and customs information.', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

Add after it:

//Start Live or test server
    tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Server', 'MODULE_SHIPPING_USPS_SERVER', 'Live', 'Use the testing or live server for transactions?<br><b>Live :</b> production.shippingapis.com/shippingapi.dll<br><b>Test :</b> testing.shippingapis.com/ShippingAPITest.dll', '6', '0', 'tep_cfg_select_option(array(\'Live\', \'Test\'), ', now())");
//End Live or test server

Find:

   return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER', 'MODULE_SHIPPING_USPS_TYPES', 'MODULE_SHIPPING_USPS_DMST_SERVICES', 'MODULE_SHIPPING_USPS_INTL_SERVICES', 'MODULE_SHIPPING_USPS_RATE_TYPE', 'MODULE_SHIPPING_USPS_RATE_SORTER', 'MODULE_SHIPPING_USPS_REGULATIONS');

Replace with:

//Start Live or test server
//        return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER', 'MODULE_SHIPPING_USPS_TYPES', 'MODULE_SHIPPING_USPS_DMST_SERVICES', 'MODULE_SHIPPING_USPS_INTL_SERVICES', 'MODULE_SHIPPING_USPS_RATE_TYPE', 'MODULE_SHIPPING_USPS_RATE_SORTER', 'MODULE_SHIPPING_USPS_REGULATIONS');
        return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_SERVER', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER', 'MODULE_SHIPPING_USPS_TYPES', 'MODULE_SHIPPING_USPS_DMST_SERVICES', 'MODULE_SHIPPING_USPS_INTL_SERVICES', 'MODULE_SHIPPING_USPS_RATE_TYPE', 'MODULE_SHIPPING_USPS_RATE_SORTER', 'MODULE_SHIPPING_USPS_REGULATIONS');
//End Live or test server

For debuging uncomment:

//echo "Body = ";
//echo $body;
//echo "<br>";


Best Regards,