Forums / Addon Shipping Modules / Bug in Australia Post Shipping Module

Bug in Australia Post Shipping Module

Started by peter_homann on 2 Aug 2006, 2:09 AM · Views: 4,356

Results 1 to 6 of 6
2 Aug 2006, 2:09 AM
#1
peter_homann avatar

peter_homann

Zen Follower

Join Date:
Jun 2006
Location:
Melbourne, VIC
Posts:
106
Plugin Contributions:
0

Bug in Australia Post Shipping Module

Hi,

I have found a bug with the Australia Post Shipping module and require help in fixing it. I believe that I know what needs to be done but I don't have an indepth knowledge of the ZenCart software or php.

In australia_post_module_3.02.zip file \catalog\includes\modules\shipping\auspostair.php line 120 states

    ```

$shipping_auspostair_cost = $charge;


where **$charge** is the value returned ifrom the Australia Post Shipping calculator called in line 80.

[http://drc.edeliver.com.au](http://drc.edeliver.com.au)

The value returned in **$charge** **Is always in Australian Dollars AUD**

Then, in line 112 we have;

$shipping_auspostair_cost = $charge;


and in line 115 we have

$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_AUSPOSTAIR_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => $shipping_auspostair_method,
'cost' => ($shipping_auspostair_cost + MODULE_SHIPPING_AUSPOSTAIR_HANDLING) + $insurance)));



The bug is that **MODULE_SHIPPING_AUSPOSTAIR_HANDLING** and **$insurance** are in the Admin set default currency, not necessarly Australian dollars AUD.

In my case I have set the Default currency to USD$. With the code as it is, it is interpreting the value in **$charge** as USD$

That is; when the calculator returns $8.50 for a postage charge, the module is interpreting it as **USD$8.50, not AUD$8.50 **

This results in the customer being over charged!

As I see it, the fix is extremely simple. the value **$charge
** returned by the Australia Post calculator needs to be divided by the AUD currency rate to convert it to the default currency. Something like;

replace line 112 with;

$shipping_auspostair_cost = $charge/ AUD_CURRENCY_RATE;



How do I replace AUD_CURRENCY_RATE with the AUD currency rate set under Admin->Localization->Curriencies?

Or is there a conversion routine I can call?

I tried;

$shipping_auspostair_cost = $charge/ currencies->value(AUD);



but it didn't work :( 

I presume I need to also do some type conversion/formating as well


Can someone please help me? I'm desperate.


Thanks,

Peter
2 Aug 2006, 2:22 AM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,723
Plugin Contributions:
0

Re: Bug in Australia Post Shipping Module

Peter-

Thank you for the report, but AusPost is a contributed module, so I am moving your post to the appropriate forum.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

3 Aug 2006, 12:10 AM
#3
joel_1 avatar

joel_1

New Zenner

Join Date:
Aug 2006
Posts:
5
Plugin Contributions:
0

Re: Bug in Australia Post Shipping Module

Hi Peter,

First time post here and looking at installing the Australia Post module for ourselves. Have you found many problems with this module or have you been able to overcome them ?

Regards,

Joel

3 Aug 2006, 1:50 AM
#4
peter_homann avatar

peter_homann

Zen Follower

Join Date:
Jun 2006
Location:
Melbourne, VIC
Posts:
106
Plugin Contributions:
0

Re: Bug in Australia Post Shipping Module

Hi Joel,

It's fairly straight forward to install and use. The bug I've reported only occurs when when your default currency is not Aussie Dollars. Not the normal situation though.

I must say I'm dissapointed in the lasck of support on this forum though.:(

Cheers,

Peter.

11 Aug 2006, 2:58 PM
#5
rwarne avatar

rwarne

New Zenner

Join Date:
Aug 2006
Posts:
1
Plugin Contributions:
0

Re: Bug in Australia Post Shipping Module

Could anyone tell me where I can download this module.

Thanks anyway but I found it!

13 Feb 2011, 9:06 AM
#6
heyits007 avatar

heyits007

Zen Follower

Join Date:
Sep 2010
Posts:
270
Plugin Contributions:
0

Re: Bug in Australia Post Shipping Module

I've got my Zone set to Queensland, Australia. Aust Post Shipping Calculator seems to calculate a higher cost to ship a product from Queensland to Queensland than from Queensland to Victoria ??? Weird.

Any Ideas why ?

Thanks,
007