Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

2 usps shipping module questions


Guest

Recommended Posts

I've activated the usps shipping module.

I signed up at the usps site

I've called them up and had my userid transferred from test to production server

 

I've searched the forums for this but can not find the answer anywhere because I am still getting the

 

"An error occured with the USPS shipping calculations.

If you prefer to use USPS as your shipping method, please contact the store owner."

 

First question is, could I be getting this error because I am using a temporary domain to develop the site before I transfer it to the domain that is up already?

 

Second question is, I have entered in all of my products in ounces because none of our products are over 1 lb. What do I need to modify in the shipping module for it to use ounces instead of pounds. I'm assuming since there is 16 oz in a pound there must be a line somewhere I can divide by 16 and have it convert. (I'm a php noob so if you could paste the code it would be really nice).

 

Sorry if this question has been answered before, I did search the forums and try to find a solution all day yesterday before posting :)

 

Thanks,

Kristin

Link to comment
Share on other sites

these lines are already in the USPS module...

 

$shipping_weight = ($shipping_weight < 0.1 ? 0.1 : $shipping_weight);

$shipping_pounds = floor ($shipping_weight);

$shipping_ounces = round(16 * ($shipping_weight - floor($shipping_weight)));

$this->_setWeight($shipping_pounds, $shipping_ounces);

 

They convert the total weight to pounds and ounces

Link to comment
Share on other sites

these lines are already in the USPS module...

 

$shipping_weight = ($shipping_weight < 0.1 ? 0.1 : $shipping_weight);

$shipping_pounds = floor ($shipping_weight);

$shipping_ounces = round(16 * ($shipping_weight - floor($shipping_weight)));

$this->_setWeight($shipping_pounds, $shipping_ounces);

 

They convert the total weight to pounds and ounces

 

The OSC is set in decimal, I assume you input the ounce weights in decimal...

 

1 ounce = .0625

 

You also have another problem, the database limits products_weight to only two places right of the decimal point. Until you correct that your weights will always be off.

 

Mike

Link to comment
Share on other sites

No, when he entered in all of the products for 13 ounces he put 13 instead of .8125 etc..

 

so i wanted to modify the script to convert it ie: multiply 13 by .0625 before it connects to the api to get the shipping cost

 

or am i way off base here lol

Link to comment
Share on other sites

Wouldn't it be easier to run an sql on the products_weight in your database, to make the change across the entire database? And when you add new products just convert to decimal at that time. If not it seems to me the following line entered into USPS will do the trick...

 

$shipping_weight = ($shipping_weight < 0.1 ? 0.1 : $shipping_weight);

$xshipping_weight = ($shipping_weight / .0625);

$shipping_weight = round($xshipping_weight , 4);

$shipping_pounds = floor ($shipping_weight);

$shipping_ounces = round(16 * ($shipping_weight - floor($shipping_weight)));

$this->_setWeight($shipping_pounds, $shipping_ounces);

 

I'm sorry I don't know anything about UPS though...

Link to comment
Share on other sites

Thanks, I'll try that

It will be easier to have the code convert than to have to figure out the decimal for every product since all of the products are under 1 lb. (they sell marbles)

 

I still cant get the shipping module to connect to the API though.. they sent the email back saying it was in production mode but i still get the same error.

 

The temp site is @ http://kristin.globalwebhost.com/rainbowturtle/ if you want to try to checkout and see what is going wrong :(

Link to comment
Share on other sites

AHHHHHHHHHHHHHHHHHHH,

My conclusion is there is no solution. It is probobly something messed up with our web servers, versions of php, sql, or something like that. I have the same problem. Mike, could you have a looksy at my site to see if it isnt fixable on behalf of the USPS Shipping module?

Link to comment
Share on other sites

  • 2 weeks later...
The temp site is @ http://kristin.globalwebhost.com/rainbowturtle/ if you want to try to checkout and see what is going wrong :(

 

I received this message when trying to access your link provided in your message above.... Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'dwight_rainbow@localhost' (Using password: YES) in /home/kristin/public_html/rainbowturtle/includes/functions/database.php on line 19

Unable to connect to database server!

 

thought you might want to know... also I'm still wondering if this issue has been resolved yet or not...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...