# Yelsaeb

Members

4

## Profile Information

• Real Name
Patrick Beasley
1. ## Problems with AusPost Calculations

Did a test order: 3x items of 12.99 kg weight. 1x item of 16.2kg weight. 10% for packaging added. What I then get is three boxes of 14.289kg each, and one box of 17.82kg. For the test, I did Melbourne to Sydney. \$9.05 base price per box, plus \$0.70 per kg, always rounded up. = \$36.20 base price + \$44.10 for the weight, = \$80.30. This was calculated manually. What osCommerce gives me is \$81 - in calculating it using the method it does it ends up with an extra kg in that order, because it adds all of the boxes together and then divides by the number of boxes, in this case giving a result of 15.171765kg per box, which gives \$44.80 for the weight, ending up with an incorrect result. Unfortunately it seems like a rather difficult process to actually implement a method of getting the correct price, and given that it doesn't seem like it will ever be more than one kilogram out, I don't think I care either.
2. ## Problems with AusPost Calculations

An update on this - using the method described above works only when multiple items of the same size are ordered, needs quite a bit of rewriting to get an accurate result for different items, as the call to get the price will need to be done once per parcel, not just once. Sorry for the delay here, I got stuck working on other modules for the last couple of weeks.
3. ## Problems with AusPost Calculations

G'day again. Noticed another problem with orders > 20kg. When the max weight of packages is set in the osCommerce admin (ie. "Enter the Maximum Package Weight you will ship" under Configuration > Shipping/Packaging) the order is split up into separate packages automatically. This is then fed to the Australia Post site, along with the weight for only a single package, thus getting an incorrect result. In addition to this, down lower in the auspost shipping module the result is then multiplied by the number of packages, so making the error even more pronounced (eg. for a very large order of 9 packages, the already wrong result back from Australia Post is then multiplied by 9). To get the correct result: Change the line beginning with "http://drc.edeliver.com.au" so that it has '&Quantity=1");' in the end instead of '&Quantity=\$shipping_num_boxes");'. That way you're only getting the price for one of the packages from Australia Post and then multiplying it later. I need to do a few more tests on this to make sure that the correct price is always returned, so don't go updating the contribution just yet unless you can test and verify this yourself.
4. ## Problems with AusPost Calculations

G'day. I was just looking into this, bit of a coincidence on the timing. :) Replace: { \$bits = split("=" ,\$contents); \$\$bits[0] = \$bits[1]; } with: \$vals = split("\n", \$contents); foreach (\$vals as \$value) { \$bits = split("=" ,\$value); \$\$bits[0] = \$bits[1]; } This only applies to the curl method - because it reads it in as one variable instead of an array. Enjoy.
×