USPS Rate V4, Intl Rate V2 (official support thread)
#181
Posted 01 May 2012 - 08:30 PM
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
Posted 02 May 2012 - 05:41 PM
NovemberDirge, on 30 April 2012 - 05:21 PM, said:
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;"> </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
Posted 03 May 2012 - 05:40 PM
Can anyone load this page ?
http://www.uspsprioritymail.com/et_regcert.html
#184
Posted 04 May 2012 - 02:12 AM
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
Posted 04 May 2012 - 02:36 PM
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?
#186
Posted 04 May 2012 - 06:36 PM
09391 is not a valid zip code.
#187 ONLINE
Posted 04 May 2012 - 06:46 PM
Regards
Jim
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
Posted 04 May 2012 - 06:57 PM
#189
Posted 04 May 2012 - 08:36 PM
Quote
tep_cfg_usps_services()
isn't being defined because you haven't finished the installation
#192
Posted 09 May 2012 - 02:04 AM
#193
Posted 12 May 2012 - 02:04 AM
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
Posted 13 May 2012 - 07:22 AM
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
Posted 17 May 2012 - 12:16 PM
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
Posted 17 May 2012 - 01:22 PM
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
Posted 03 June 2012 - 07:17 PM
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
Posted 19 June 2012 - 01:30 AM
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
Posted 19 June 2012 - 01:49 AM
sunrise99, on 19 June 2012 - 01:30 AM, said:
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
Posted 21 June 2012 - 03:14 PM
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('/\<sup\>\&reg;\<\/sup\>/', '/\<sup\>\&trade;\<\/sup\>/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '",', '" ', '"<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('/\<sup\>\&reg;\<\/sup\>/', '/\<sup\>\&trade;\<\/sup\>/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '",', '" ', '"<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('/\<sup\>\&reg;\<\/sup\>/', '/\<sup\>\&trade;\<\/sup\>/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '",', '" ', '"<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,









