Post by celli29 » Tue Dec 28, 2010 11:40 pm

Hi all,

I'm using OC 1.4.9.1 and linked USPS API to mine.
I'm going to sell a product, whose weight is around 0.7 oz. So, mainly, if I use USPS, it's going to be FIRST CLASS MAIL service. I have read several ones here, but I'm not sure it's clearly solved or not.

My problem is when I purchase one product (0.7oz) and see the checkout, it shows $2.92, which is corresponding to 11 oz. I guess it reflects pound instead of ounce. Because if 0.7 oz is set to 0.7 lb by mistake, 0.7 lb is approx. 11 oz. I set ounce for default weight. If anyone knows how to solve it, or where can I find the solution, please let me know. Thanks in advance!!

Newbie

Posts

Joined
Wed Apr 14, 2010 2:05 pm

Post by celli29 » Tue Dec 28, 2010 11:53 pm

Just FYI:

USPS first class mail parcel table:
(upto)
1 ounce $1.22
2 ounces $1.39
3 ounces $1.56
4 ounces $1.73
5 ounces $1.90
6 ounces $2.07
7 ounces $2.24
8 ounces $2.41
9 ounces $2.58
10 ounces $2.75
11 ounces $2.92
12 ounces $3.09
13 ounces $3.26

Newbie

Posts

Joined
Wed Apr 14, 2010 2:05 pm

Post by celli29 » Thu Dec 30, 2010 12:59 pm

I think I found why it shows wrong rate of USPS first class mail.

In the file, USPS.php, there are three lines for converting pound to (pound and ounces).

$weight = ($weight < 0.1 ? 0.1 : $weight);
$pounds = floor($weight);
$ounces = round(16 * ($weight - floor($weight)));

These three lines actually converts a.b pound to a pound to c ounces.
But these lines are applied not only to the pounds but also to ounces.
This means when my product's weight is 0.7 ounces, it converts my weight to 0 pound 11 ounces.
That's why I always saw $2.92 instead of $1.22.
So I just added if statement for those three lines so they only can be applied to pounds.
I hope this helps out.

Newbie

Posts

Joined
Wed Apr 14, 2010 2:05 pm

Post by SuzieQue » Thu Aug 18, 2011 10:38 pm

Celli29,

I have the same problem, but I'm not a PHP programmer. Would you mind sharing what you changed the code to? Thanks in advance!!

Newbie

Posts

Joined
Mon Jun 27, 2011 2:11 am

Post by Qphoria » Thu Aug 18, 2011 11:37 pm

This has long been fixed in the latest 1.4.9.5 and 1.4.9.6

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SuzieQue » Fri Aug 19, 2011 2:36 am

I'm using v1.5.0.5 and I have the same problem in this OC version.

Newbie

Posts

Joined
Mon Jun 27, 2011 2:11 am

Post by Qphoria » Fri Aug 19, 2011 2:52 am

lol i didn' t say 1.5.x
only 1.4.9.5 and 1.4.9.6 :)
it has to be ported to 1.5.x still

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SuzieQue » Fri Aug 19, 2011 6:00 am

Anyone have an ETA on this fix? Again, I am not a programmer. Thank you!

Newbie

Posts

Joined
Mon Jun 27, 2011 2:11 am
Who is online

Users browsing this forum: No registered users and 1 guest