VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Shipping Modules => Topic started by: thebeardman on May 06, 2010, 12:08:57 pm

Title: Simple AustraliaPost Shipping Module
Post by: thebeardman on May 06, 2010, 12:08:57 pm
This module allows you to calculate shipping fees with Australia Post for inside deliveries (as VirtueMart default one) but also for outside Australia shipping.

WHAT IT DOES:

WHERE DO I FIND IT:
On Joomla Forge http://forge.joomla.org/gf/project/simplevmaddons/ (http://forge.joomla.org/gf/project/simplevmaddons/)
Download the version 1.5.2 directly http://forge.joomla.org/gf/download/frsrelease/11291/50098/Virtuemart_SimpleAustPostShipping_1.5.2.zip (http://forge.joomla.org/gf/download/frsrelease/11291/50098/Virtuemart_SimpleAustPostShipping_1.5.2.zip)
Any trouble? http://forge.joomla.org/gf/project/simplevmaddons/tracker/ (http://forge.joomla.org/gf/project/simplevmaddons/tracker/)

Let me know if you like it or not.
Title: Re: Simple AustraliaPost Shipping Module
Post by: nesta on May 07, 2010, 06:23:18 am
Thanks very much for the module Bruno. It installed in seconds but when functional a debug message is displayed above the rates.
------------- [DEBUG OUTPÜT] --------------

--------- Sullivans Cove Double Cask 150ml ------------------
Weight in base: 0.5000 kg
Conversion: 500 g
Total (x4): 2000g
--------- END Sullivans Cove Double Cask 150ml------------------

--------- TOTAL PARCEL VALUES ------------------
Weight : 2000 g
Length : 50 mm
Height : 50 mm
Width : 50 mm

------------- URL SEND TO CALCULATOR --------------
http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=7170&Destination_Postcode=7173&Country=AU&Weight=2000&Length=50&Width=50&Height=50&Quantity=1
------------- END URL --------------

------------- [DEBUG OUTPÜT] --------------

Australia Post Standard: $9 (2 kg)
Australia Post Express: $12 (2 kg)


I have display error messages off yet the above message is still displayed. Be great to have this problem solved as a great module.
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on May 07, 2010, 08:01:45 am
Hello,
Did you put the variable $_debug = 0 at the line 46?
It should works.

Thanks for using my extension. Let me know your opinion about it.
Title: Re: Simple AustraliaPost Shipping Module
Post by: wsfsb on May 17, 2010, 03:30:18 am
G'day Bruno,

Nice work.

I noticed it still needs URL file access to call the Auspost site.  Many servers using PHP 5.2 onwards have allow_url_fopen and allow_url_include off as default to prevent attacks.

Couldnt get it to work with our server config.

Jason
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on June 30, 2010, 02:31:39 am
Hi,

This is a nice module, however, it has suddenly stopped working for me. It is just not showing up at the frontend cart shipping options. i have tried other shipping modules and they are all working fine. the Simple Aust Post module is selected in the admin configuration and has been activated in the shipping module list. But it's just stopped showing up for no apparent reason.

I am using Joomla 1.5.18 and Virtuemart 1.1.14. Any clues as to why this has happened?

Many thanks
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on July 01, 2010, 19:55:53 pm
Which version do you use for this shipping method?
You can see which one is it when editing one of the file.
Let me know if you still have this problem and we will try to find a solution together.
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on July 01, 2010, 23:39:12 pm
Hi Bruno,

Thanks for your reply. The version is 1.5.2 , there is still a problem with it (not showing at frontend) and we are having to use the normal Aust Post shipping module for the time being
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on July 01, 2010, 23:55:29 pm
Try to install the latest release version 1.5.3, you can download it by using the following link: http://bit.ly/ag3QKr
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on July 06, 2010, 10:30:28 am
Hi Bruno,

I have just downloaded and installed the 1.5.3 version. it does show up now and calculates the postage but I receive this error:

Warning: Division by zero in /home/bibbat/public_html/administrator/components/com_virtuemart/classes/shipping/simpleauspost.php  on line 97

any reason for this?

thank you.

Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on July 06, 2010, 10:49:34 am
Hello,

Edit your file and on line 97 replace these lines:
Code: [Select]
//Calculate the number of Boxes needed for this product so we can add to the height
if ((int)($cart[$i]["quantity"]) > ((int)(($dboi->f("product_packaging")>>16)&0xFFFF))) {
    $numboxes = ceil(($cart[$i]["quantity"]) / (($dboi->f("product_packaging")>>16)&0xFFFF));
} else {
    $numboxes = 1;
}

by those ones:
Code: [Select]
//Calculate the number of Boxes needed for this product so we can add to the height
$numboxes = 1;
if (($dboi->f("product_packaging"))
{
        if ((int)($cart[$i]["quantity"]) > ((int)(($dboi->f("product_packaging")>>16)&0xFFFF))) {
          $numboxes = ceil(($cart[$i]["quantity"]) / (($dboi->f("product_packaging")>>16)&0xFFFF));
        }
}

Let me know if it is working!
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on July 06, 2010, 11:02:34 am
Hi

I'm afraid it's still not working.
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on July 06, 2010, 11:08:03 am
try by using
Code: [Select]
if (($dboi->f("product_packaging") > 0) instead of
Code: [Select]
if (($dboi->f("product_packaging"))
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on July 10, 2010, 02:27:45 am
Hi Bruno,

Just tried that code adjustment, unfortunately now it comes without any CSS styling, and no shipping methods. With this error

Parse error: syntax error, unexpected '{' in /home/bibbat/public_html/administrator/components/com_virtuemart/classes/shipping/simpleauspost.php on line 99
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on July 10, 2010, 09:06:43 am
I wasn't awake enough when I gave you the code. Replace the previous line by this one:
Code: [Select]
if ($dboi->f("product_packaging") > 0)Sorry for this mistake.
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on July 12, 2010, 09:19:54 am
That seems to be working now.

Thank you!

excellent little module.
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on July 14, 2010, 01:36:48 am
Hey Bruno,

sorry i have another little error.. on a different website: when the customer enters an international shipping address this this error displays:

Australia Post shipping calculator failed, reason: "robots" content

I have tested it for USA addresses and it seems to be OK but when testing with Dutch or UK addresses the above error comes up. Not sure about other international destinations but the products sold on the site will hopefully be sold globally so all international shipping needs to work.

Is there some setting that i've missed to stop this error? Any help would be much appreciated.

Many thanks as always   :)

Title: Re: Simple AustraliaPost Shipping Module
Post by: joely on July 14, 2010, 04:21:03 am
Hi Bruno,

This is an awesome module - thanks heaps. I was just wondering on my checkout screen of my website where the user has the option to select either Australia Post Express or Australia Post Standard it displays the delivery time under these but for some reason they both say 1 day when it should say 3-5 days for standard postage.

How do I make it say 3-5 days for standard postage?

Also how accurate is this as a postage cost calculator? Does it pull the prices from the Australia Post website?

Thanks for your help, greatly appreciated, and great job!
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on July 14, 2010, 09:18:03 am
Hi everyone,
@firefly: I never had this error. This is a message sent by Australia Post calculator, and the shipping methods only displays it. You can activate the debug mode by changing on line 47
Code: [Select]
$_debug = 1; it will output the different values, so you can post it here.

@joely: Which version are you using? I couldn't reproduce the error with the latest one (1.5.3). Same advice as Firefly, put on mode debug and post here the output.

Regards.
Title: Re: Simple AustraliaPost Shipping Module
Post by: joely on July 16, 2010, 02:50:20 am
Hi Bruno, I am using version 1.5.3 and this is the output of my code:



Please select a Shipping Method!
Code: [Select]
------------- [DEBUG OUTPÜT] --------------

--------- 1kg Nitric Stack Matrix Lemon Lime Flavour ------------------
Weight in base: 1.0000 kg
Conversion: 1000 g
Total (x1): 1000g
Number of Boxes: 0
--------- END 1kg Nitric Stack Matrix Lemon Lime Flavour------------------

--------- 3kg Recovery Matrix Vanilla Flavour ------------------
Weight in base: 3.0000 kg
Conversion: 3000 g
Total (x1): 3000g
Number of Boxes: 0
--------- END 3kg Recovery Matrix Vanilla Flavour------------------

--------- TOTAL PARCEL VALUES ------------------
Weight : 4000 g
Length : 320 mm
Height : 50 mm
Width : 320 mm

------------- URL SEND TO CALCULATOR --------------
http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=4221&Destination_Postcode=4221&Country=AU&Weight=4000&Length=320&Width=320&Height=50&Quantity=1
------------- END URL --------------

------------- [DEBUG OUTPÜT] --------------
Australia Post Standard: $12.70 (4 kg)
  Delivery time (estimated by Australia Post): 1 days
Australia Post Express: $15.55 (4 kg)
  Delivery time (estimated by Australia Post): 1 days


you can see that both standard and express show 1 day as the delivery time.
Oh silly me that's probably because the business is in the same suburb as where it would be delivered to hey?

I have also noticed a different issue after doing seeing this output. In this order I have 2 products with the following dimensions:

1kg Nitric Stack Matrix Lemon Lime Flavour
Length - 32cm
Width - 32cm
Height - 27cm

3kg Recovery Matrix Vanilla Flavour
Length - 17cm
Width - 17cm
Height - 23cm

and as it shows the total parcel values:

--------- TOTAL PARCEL VALUES ------------------
Weight : 4000 g
Length : 320 mm
Height : 50 mm
Width : 320 mm

These are far too small to fit those 2 products in.
How can I fix this?


Cheers for your help, this is greatly appreciated,
Joel

Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on July 16, 2010, 09:22:34 am
Hello,
So everything works fine?
About the parcel dimensions, I still need to improve the system. But it is not a real issue as it isn't linked with the prices. It needs to be sent to the eCalculator only to be sure the parcel isn't too small or too big. For now, if the products weight is over 20kg, the shipping price won't work as it is too big for one parcel.
In the next release, I will add this feature:
 * calculate the girth based on the products dimensions;
 * use more than one parcel if needed;
 * additionate all the parcel prices.

That's all I can say, if you have others ideas or features needed, please let me know:  http://bit.ly/b0rt1E (http://bit.ly/b0rt1E)

You can also find a Live eCalculator i have done based on this shipping method. As you know, you can find the shipping cost only when the customer checkout, with this module, you can display the cost in a module: http://bit.ly/ce9Urp (http://bit.ly/ce9Urp)
Title: Re: Simple AustraliaPost Shipping Module
Post by: joely on July 18, 2010, 11:29:01 am
Ok cheers mate.
So basically it is correct according to weight and that's all that matters as long as the parcel isn't too big or too small.
Loving your work,
cheers for the guidance, greatly appreciated.
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on July 19, 2010, 00:02:12 am
Hi Bruno

thanks for the reply. here is the debug output
Code: [Select]
------------- [DEBUG OUTPÜT] --------------

--------- Large Engine Mount Kit ------------------
Weight in base: 36.0000 grams
Conversion: 36.0000 g
Total (x1): 36g
Number of Boxes: 1
--------- END Large Engine Mount Kit------------------

--------- TOTAL PARCEL VALUES ------------------
Weight : 36 g
Length : 250 mm
Height : 60 mm
Width : 150 mm

------------- URL SEND TO CALCULATOR --------------
http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=2484&Destination_Postcode=RG12 7NE&Country=GB&Weight=36&Length=250&Width=150&Height=60&Quantity=1
------------- END URL --------------

------------- [DEBUG OUTPÜT] --------------

Australia Post shipping calculator failed, reason: "robots" content

Australia Post shipping calculator failed, reason: "robots" content

So i am a bit lost as to what to do about it, as mentioned before this error doesn't happen with Australia or US destinations. Do Australia Post have a list of error codes and reasons?

Many thanks
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on July 19, 2010, 00:46:46 am
Hi Bruno

I think i may have found the problem... UK postcodes are usually 8 digits long but have a space in the middle so like "xxx xxx" - i removed the space and it works.
Dutch postcodes also have a space and i'm sure there any many more international destinations that do. So I is there a 'workaround' for this i do i just need to adjust the text to say 'no spaces'

Thank you!
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on July 19, 2010, 08:26:55 am
Hi firefly,

When I saw your debug output, I thought it was the postcode with blank spaces. What you can do, it is add the following codes just before the
Code: [Select]
switch($Order_Service_Type) around lines 190 :
Code: [Select]
$uri = str_replace(' ', '', $uri);It will remove all the spaces before sending the url to the calculator.
Let me know how it will works after that.

Regards.
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on July 19, 2010, 09:48:52 am
That worked! many thanks! ;D
Title: Re: Simple AustraliaPost Shipping Module
Post by: costicanu on August 16, 2010, 19:06:32 pm
Hi, i'm using joomla Joomla 1.5.20, and  virtuemart  1.1.5. I copied your files into administrator\components\com_virtuemart\classes\shipping.

The default australian virtuemart module is working, but this one is not.

Errors:
Notice: Undefined offset: 1 in C:\wamp\www\joomla\administrator\components\com_virtuemart\classes\shipping\simpleauspost.php on line 246

Notice: Undefined offset: 1 in C:\wamp\www\joomla\administrator\components\com_virtuemart\classes\shipping\simpleauspost.php on line 249

Notice: Undefined offset: 1 in C:\wamp\www\joomla\administrator\components\com_virtuemart\classes\shipping\simpleauspost.php on line 250

Notice: Undefined offset: 2 in C:\wamp\www\joomla\administrator\components\com_virtuemart\classes\shipping\simpleauspost.php on line 253

Notice: Undefined offset: 1 in C:\wamp\www\joomla\administrator\components\com_virtuemart\classes\shipping\simpleauspost.php on line 254

Australia Post shipping calculator failed, reason:



If you want to see, those are the details about the shop:
http://92.114.126.122/joomla
username: admin
pwd: administrator
No registration required for buying products. I tried to buy a hammer, but is not working.
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on August 16, 2010, 23:59:28 pm
Hi costicanu,

Which version do you use of the simple australiapost shipping method do you use?
I will look to your problem as soon as possible and I will keep you posted.

Regards,

Bruno
Title: Re: Simple AustraliaPost Shipping Module
Post by: costicanu on August 17, 2010, 17:56:23 pm
Thank you for your reply thebeardman.
In readme file of Australia module says: @version 1.5.3
Title: Re: Simple AustraliaPost Shipping Module
Post by: nichola on September 16, 2010, 10:49:35 am
I am getting this error on the module:

Warning: urlencode() expects parameter 1 to be string, array given in /home/fireandl/public_html/modules/mod_simple_australiapost_ecalculator/helper.php on line 534

thank you
Title: Re: Simple AustraliaPost Shipping Module
Post by: nichola on September 17, 2010, 08:26:40 am
I am getting this error on the module:

Warning: urlencode() expects parameter 1 to be string, array given in /home/fireandl/public_html/modules/mod_simple_australiapost_ecalculator/helper.php on line 534

thank you

[please i am desperate for help with this]
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on September 17, 2010, 14:10:40 pm
Hi Nichola, I will have a look to your error and keep you posted about this.
Title: Re: Simple AustraliaPost Shipping Module
Post by: nichola on September 19, 2010, 01:42:03 am
Thanks for quick reply look forward to your answer
cheers Nichola
Title: Re: Simple AustraliaPost Shipping Module
Post by: nichola on September 20, 2010, 06:36:34 am
Dear Bruno,
i was hoping you may have had a chance to look at my error

Warning: urlencode() expects parameter 1 to be string, array given in /home/fireandl/public_html/modules/mod_simple_australiapost_ecalculator/helper.php on line 534
www.fireandlime.com

cheers Nichola
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on September 20, 2010, 08:04:38 am
Hi Nichola,

I'm sorry if it takes more time. First of all, you can set the debug ON. It will display some output. The line I'm interested in is "Url:[...]" which is the url used to retrieve informations from AustraliaPost.
Also, let me know the version of the module installed.
Title: Re: Simple AustraliaPost Shipping Module
Post by: nichola on September 20, 2010, 12:01:35 pm
Thank you so much Bruno,

simple auspost 1.5.5
module 1.6.1
virtuemart is 1.1.5
joomla is 1.5.20

i have turned debug on in virtuemart and joomla and set module to show errors

cheers Nichola
Title: Re: Simple AustraliaPost Shipping Module
Post by: marinos on September 20, 2010, 13:05:32 pm
module works great. finally an active developer on an Australian post module for virtuemart.

1 thing I cant get working on this module and other aust post modules I have tried. when I activate the virtuemart currency converter module form joomla modules, when the user changes currencies, the price of shipping stays the same number and does not change like the rest of the cart. only thing that changes is the currency name and symbol but not the number. any help on this.
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on September 20, 2010, 18:33:44 pm
Hi Marino,
I will work on it and post a new release as soon as possible.
You can follow this post: http://forge.joomla.org/gf/project/simplevmaddons/tracker/?action=TrackerItemEdit&tracker_id=9293&tracker_item_id=22304
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on September 20, 2010, 18:43:11 pm
Hi Nichola,
Could you turn on also, the debug mode for the module?
To do it, you need to edit the file helper.php in the folder /modules/mod_simple_australiapost_ecalculator.php and change the value of the line 144 from var $_debug = 0; to var $_debug = 1;
Save the file and upload on your server.
Also make sure, all your products have a weight in their description. Otherwise the calcul will be wrong.
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on September 20, 2010, 22:14:50 pm
Hi Marino,
I just released a beta version to test currency conversion with this module. Could you test it for me, and let me know if it does concert? Here the link: http://forge.joomla.org/gf/download/frsrelease/12887/55599/VirtueMart_SimpleAustPostShipping_1.5.6.zip
Title: Re: Simple AustraliaPost Shipping Module
Post by: nichola on September 20, 2010, 23:15:13 pm
Dear Bruno,
I have set the module debug to on.

some of my products such as cards and wrapping paper don't have a weight, should i set a minimum weight to these?

cheers Nichola
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on September 20, 2010, 23:55:57 pm
Hi Nicholas,
You will find a new helper.php file attached. Replace the old one by this one (renamed it first).
It should correct these errors (weight and url encode). Let me know if this doesn't work.

-- EDIT: I changed the file, this one should work --

[attachment cleanup by admin]
Title: Re: Simple AustraliaPost Shipping Module
Post by: nichola on September 21, 2010, 00:09:59 am
Dear Bruno,
I have uploaded the file, cleared caches but the error is still there.
cheers Nichola
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on September 21, 2010, 00:20:22 am
See private message
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on September 21, 2010, 00:29:46 am
Hi Nichola, I changed the helper. Let me know about the new one. See post above.
Title: Re: Simple AustraliaPost Shipping Module
Post by: nichola on September 21, 2010, 01:30:01 am
Dear Bruno,
All is working well, thanks for great support, module looks great on my website
and I am very happy
cheers Nichola
Title: Re: Simple AustraliaPost Shipping Module
Post by: marinos on September 21, 2010, 16:41:41 pm
Hi Brono

thanks for the update. the currency selector is working fine now, all postage prices are converting in the shopping cart.

there is another issue though with the paypal payment module, once I click confirm order and get forwarded to paypal for payment, the totals change. I have added some screenshots to show what I mean.

In this order:
- image "1 aud.png" shop is original in AUD
- image "2 usd.png" user users the currency selector and selects usd currency. shipping currency converts perfectly. user selects Australia air post before continuing
- image "3 paypal.png" postage price is incorrect and so is currency, it should be usd
- image "4 email to admin" email states usd instead of aud since paypal thinks its aud

this issue has an explanation found at the link below but I haven't tested it yet. do you think this would this work?
http://forum.virtuemart.net/index.php?topic=44648.0



[attachment cleanup by admin]
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on September 23, 2010, 19:08:03 pm
Hi Marino,
Could you try by using the standard module? Just to check if this is a common bug of VirtueMart.
Title: Re: Simple AustraliaPost Shipping Module
Post by: marinos on September 27, 2010, 04:49:53 am
Hello Brono

I tested it using the original Australian post mod.

- The postage value does not change when I change currency
- then when I click confirm and go to paypal it looks like the postage price changes again in the wrong direction.

here are a few screen shots in this orger
- postage price in AUD
- user selects USD from currency module
- Cart totals before continue to paypal
- Paypal Summary


[attachment cleanup by admin]
Title: Re: Simple AustraliaPost Shipping Module
Post by: firefly on October 13, 2010, 04:58:47 am
Hi Bruno

I have a new problem. one of my client's customers can't make a purchase because of this error:
Quote
Australia Post Shipping Calculator failed. reason: invalid country selected

The customer is in Turkey. i tested it with the normal Aus Post calculator and it worked but it has errors with other countries so would rather use your module.

not sure what to do about this one? have you heard of this problem before?
thanks
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on October 13, 2010, 07:09:37 am
Hi Firefly,
I never had this error before, but I will check and get back to you.
Could you post a bug report here? http://forge.joomla.org/gf/project/simplevmaddons/tracker/?action=TrackerItemBrowse&tracker_id=9293
It helps keep tracking on bugs.
Thank you.
Title: Re: Simple AustraliaPost Shipping Module
Post by: ep on November 10, 2010, 03:47:07 am
I am new to Joomla and Virtuemart.
I have installed the 1.5.7 version with no problem. However it doesn't return any value in the shipping cost. If I just pass the url(use debug) I can get the value returned.
Is there anything I need to configure ?



Find out what's wrong. you have to install curl for php.
Title: Re: Simple AustraliaPost Shipping Module
Post by: anthony on November 11, 2010, 03:30:35 am
I have joomla 1.5.22 + VM 1.1.5 + Simple AusPost 1.5.7.
I cant get it to return a price for shipping. I have curl enabled on my server.

1 PARCEL for 0.01 KG
Australia Post Standard: $0.00

Any thoughts?
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on November 11, 2010, 11:04:37 am
Hi Anthony,

Update the method with this new version (1.5.9): http://bit.ly/96ppzN
After that, if you still have this error, activate the debug mode.
Have a good day!

Regards,

Bruno

Title: Re: Simple AustraliaPost Shipping Module
Post by: anthony on November 11, 2010, 21:35:38 pm
Thanks Bruno,

Ive updated to 1.5.9. Im still not getting any prices returning. Ive checked that Standard shipping works so its not a VM issue. I've turned on debug but I'm not sure what i'm looking for.

$_POST:     
$_GET:    view=>frontpage
$_COOKIE:    
$_SESSION:    __default=> {Array}
VMCHECK=>OK
auth=> {Array}
cart=> {Array}
recent=> {Array}
ps_vendor_id=>1
minimum_pov=>0.00
vendor_currency=>AUD
usefetchscript=>0
userstate=> {Array}
last_page=>checkout.index
vmUseGreyBox=>0
vmCartDirection=>0
savedcart=> {Array}
product_sess=> {Array}
simpleauspost%7CAustralia+Post%7CStandard%7C0.00=>1
simpleauspost%7CAustralia+Post%7CExpress%7C0.00=>1
standard_shipping%7CDHL%7CWorld_2+%3E+20kg%7C126.20%7C20=>1
     
$vars:    option => com_virtuemart
Itemid => 72
user_id => 62
page => checkout.index
func => checkoutProcess
zone_qty => 1
ship_to_info_id => 56da17e895e69a2dfda5cc492441dc8f
shipping_rate_id =>
payment_method_id => 0
checkout_last_step => 1
formSubmit => Next >>
virtuemart => qt0ver0oas0ahskuq5culjl9n3
ys-vmconfiguration-active => s:ext-comp-1006
ys-debugpanel-active => s:ext-comp-1004
mynxx-fontstyle => f-default
7105e6b5c2c9897c946c3bccafb7c4de => a372cc76306cf13d6625c97dd62e9b50
37cbbe913dd01e76207ed4e4dde8d955 => 22c147190e804394cfb6d0c40ae6c643
switchmenu => 1
view => frontpage
user_info_id =>
order_subtotal_withtax => 1266.44
payment_discount => 0
total => 1266.44
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on November 12, 2010, 00:30:09 am
Hi,
You need to activate the debug mode on the shippping method.
Go to the configuration panel of the shipping method and activate the Debug mode. Then post the output here.
Title: Re: Simple AustraliaPost Shipping Module
Post by: anthony on November 12, 2010, 04:32:43 am
Champion!
There was a space in the postcode field causing an invalid pick up error.

Thanks Bruno.
Title: Re: Simple AustraliaPost Shipping Module
Post by: johnnynova on November 14, 2010, 01:49:56 am
Hi all, best mod yet for aus postage.
I've been trying to get the mod to include cost for using pre-paid satchels. I understand php a fair bit, but far from being a programmer. I realize that the DRC doesn't return these figures and been trying to use the 'static' prices for the 5oogm and 3k satchels. Been using the ozpost.php files I have on a zen-cart site as a bit of a guide, but to no avail. Anyone else trying to do this? Been successful? Have any suggestions? So far, All I've been able to do it get it to show the option, but it's not showing the price. I'll still have to write the 'if' statement, but if someone could guide me in the right direction to get it to show the price I would appreciated it.
David
Title: Re: Simple AustraliaPost Shipping Module
Post by: johnnynova on November 14, 2010, 02:32:39 am
Hi again, thought I should add more info..
So far I have added this around line 50ish
Code: [Select]
var $_services = array(
'EXPRESS' => 'Express',
'STANDARD' => 'Standard',
'AIR' => 'By Air',
'SEA' => 'By Sea',
'PPS5' => 'Pre-Paid Satchel 500gm',
'PPS2' => 'Pre-Piad Satchel 2k'
);

And around line 137ish modified this
Code: [Select]
  var $_rates = array(
   'PPS5' => '6.00',
   'PPS3' => '10.30'
);

And, so far at around 375(this will need an if statement) I've got this, using the top 'chunk' as a template. (cuz I don't know what I'm doing)
Code: [Select]
              // Express rate for Australian Shipping
              $this->parcels[$key]['Service_Type'] = 'EXPRESS';
              $rates = explode("\n", $this->_get_content($this->_prepare_url($this->parcels[$key])));
              $this->parcels[$key]['Rates'][] = $this->_prepare_rate($rates, $this->parcels[$key]['Service_Type']);
             
              // Pre-Paid Satchel Australian Shipping
              $this->parcels[$key]['Service_Type'] = 'PPS5';
              $rates = explode("\n", $this->_get_content($this->_prepare_url($this->parcels[$key])));             
              $this->parcels[$key]['Rates'][] = $this->_prepare_rate($rates, $this->parcels[$key]['Service_Type']);

I've tried using this for the second line in my 'chunk'
Code: [Select]
$rates = 'PPS5';but it makes no difference. I also tried quite a few different things in there, tried changing the var $rates array, even tried to create a new array 'cost' and implement that. Most of those efforts just broke it.

Hope that info helps.
Thanks,
David
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on November 16, 2010, 13:04:31 pm
Hi johnnynova,

Sorry for not answering earlier. This won't work as it send the service to the DRC website. But because this rate isn't handled by AustraliaPost, it won't work.
What I can suggest is by modifying this :
Code: [Select]
/ Pre-Paid Satchel Australian Shipping
              $this->parcels[$key]['Service_Type'] = 'PPS5';
              $rates = explode("\n", $this->_get_content($this->_prepare_url($this->parcels[$key])));             
              $this->parcels[$key]['Rates'][] = $this->_prepare_rate($rates, $this->parcels[$key]['Service_Type']);
Try without the _get_content() function because it is this function which call the webservices.
And you can force $this->parcels[$key]['Rates'][] by adding your own prices.
I didn't try this so I don't know how it will work.
Let me know about your research.

Regards.

Title: Re: Simple AustraliaPost Shipping Module
Post by: johnnynova on November 17, 2010, 09:43:06 am
Thanks beardman, I'll give that a try and let you know how it goes. No worries about responding 'late'. It's not late at all, your helping out and that's admirable.  I don't expect 'quick service' for free help. I do appreciate your time.
David
Title: Re: Simple AustraliaPost Shipping Module
Post by: freshweb on January 21, 2011, 04:36:39 am
Hi,  I love this module! Thank you.

I need to add some additional services types via australia post as listed below. 

Domestic
Registered Post
Express Post Platinum
 
International
Registered Post international
Express Post International

Can you please let me know if this is possible and some guidelines on how to do it.

Kind Regards

Shannon ;D
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on January 21, 2011, 08:32:57 am
Hi, thank you.

@aquapixel I will add this option in the next release
@freshweb I will add these options in the next release

If you want to let me know about bugs, or some features please use the tracker system on the Joomla Forge here: http://forge.joomla.org/gf/project/simplevmaddons/tracker

For me it is easier to have all requests on the same place, so I am sure, I am not forgotting something.*

Thanks
Title: Re: Simple AustraliaPost Shipping Module
Post by: aquapixel on April 15, 2011, 12:37:54 pm
Thanks thebeardman,

I'll look out for your next release!

Cheers:)
Title: Re: Simple AustraliaPost Shipping Module
Post by: ps4u on May 01, 2011, 06:27:14 am
Hello Thebeardman,

First off, excellent module, I've just been looking at it and it just what we need. One question you may be able to help with? (background) we post our items in the pre-paid satchels 500g & 3kg, when a customer orders orders, say, 5 of a particular item, they don't fit in the bags, but still charges our standard postage rate and it costs us more to post the larger parcel. Are you able to help? I'm trying to set the 'Product Dimensions' but the default is in inches and I know OZ post want it in mm, how can I change the default to mm or convert to inches or what?

Thanks in advance ....Cheers Greg
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on May 06, 2011, 07:56:03 am
@greg: The calculator doesn't use the dimensions to calculate the prices, it is only to make sure the parcel isn't too large. The price is based on the products weight. If you only want to use satchels 500g or 3kg, maybe it will be better for you to use the standard shipping module.
Title: Re: Simple AustraliaPost Shipping Module
Post by: grzx on May 06, 2011, 08:50:32 am
I need to modify the codes for local shipment to have below system.

We charge $6.90 flat rate for shipping within Australia but we waive postage for any purchase over $100.

As for the international shipping, it is perfect.

Can you please help on this?
Title: Re: Simple AustraliaPost Shipping Module
Post by: Dog_Guy on June 07, 2011, 08:25:18 am
@greg: The calculator doesn't use the dimensions to calculate the prices, it is only to make sure the parcel isn't too large. The price is based on the products weight. If you only want to use satchels 500g or 3kg, maybe it will be better for you to use the standard shipping module.

Mr beardman.

I am a novice at joomla and by extension, virtuemart. I was recommended to use virtuemart because of the auspost calculator, but I have not been able to alter it and have read nothing but issues in threads on this site.

While I have posted this request elsewhere, it seems you may be the local area expert on it. So please consider my theories, questions and requests.

i wish to have two postage options, one is for local customers within a few kms of where I live. I will deliver personally to them for $5. Everyone else pays auspost rates. Ideally for this it would compare the postcode of their home with the postcodes (about ten that I input into a config screen) and either lets them choose that option just doesnt show it if they are out of zone.


In another forum someone said that the old version of auspost module bundled with vm didnt use the Australian post calculator because aus post dont have an api to gain info from, just html page results.

I live in Melbourne and figured that the auspost module would take the postcode I gave in the configuration as my home address then find the cheapest post rates to any other postcode in aust.

I rang aus post and was told not to use boxes (and dimensions) in most calculations as either the standard 500g or 3 kg red bag satchels would be cheaper than boxes, or 'free form' (packed into a rugged cardboard parcel) may be cheapest - for this you just need the weight (as long as its reasonably small in size and under 20kg.

at the moment the VM auspost module is delivering a fee of $26 to post 400g or 3 kg FROM my address, TO my address. WRONG!

As all I can see is the option for turning the bundles vm auspost option on or off, there is no way to configure it?

I sell pet treats by the bag that are either small sizes such as 100g to 250g or bulk bags of 1kg. it would be great if an auspost module existed for VM that allowed you to choose for it to display either the higher or lower postage rate calculated from using either a satchel or packing it yourself. And do it on dynamic auspost data (or at least allow you to edit rates as they change them)

I would have thought that this would have been resolved by now, but all I keep reading is people having issues with small programming patches, that the average user may not want to do or may not have the skills to do.

Any ideas?
Title: Re: Simple AustraliaPost Shipping Module
Post by: Dog_Guy on June 07, 2011, 09:03:24 am
I tried to download your auspost version from joomla extensions but i have vm 1.1.8 and when i tried uploading the patch, it said there was a version mismatch?
Title: Re: Simple AustraliaPost Shipping Module
Post by: Cheetaa on June 16, 2011, 11:55:35 am
Gidday to the Beardman,
I have just installed the mod_simpleaustraliapostcalculator_1.6.1.zip on my test site to use in my VM cart. I have enabled the module, set it position to the right and opened up my test website (local test site on my home computer, not the live website) and I have some errors.
Warning: explode() expects parameter 2 to be string, array given in C:\xampp\htdocs\cool\modules\mod_simple_australiapost_ecalculator\helper.php on line 408

Warning: urlencode() expects parameter 1 to be string, array given in C:\xampp\htdocs\cool\modules\mod_simple_australiapost_ecalculator\helper.php on line 534

Warning: explode() expects parameter 2 to be string, array given in C:\xampp\htdocs\cool\modules\mod_simple_australiapost_ecalculator\helper.php on line 413
There is one item in the shopping cart, it has a weight of 0.01kg.
Joomla version = 1.5.15
VirtueMart version = 1.1.7
Any help to resolve the errors would be appreciated please.
Title: Re: Simple AustraliaPost Shipping Module
Post by: luana_r801 on August 04, 2011, 15:18:14 pm
Hi,

I am using the SimpleAustPost module with VM and i get this error when the weight of the parcel exceeds 20Kgs.

Please select a Shipping Method!

Australia Post shipping calculator failed, reason: Invalid weight parameter...

Can you please help me?

Thanks.

LR
Title: Re: Simple AustraliaPost Shipping Module
Post by: Gippsweb on August 30, 2011, 00:32:29 am
Hi,
I am using the SimpleAustPost module with VM and i get this error when the weight of the parcel exceeds 20Kgs.
Please select a Shipping Method!
Australia Post shipping calculator failed, reason: Invalid weight parameter...
Can you please help me?
Thanks.
LR
In the settings for the module, enable multiple parcels. (Or make sure everything you sell weighs less than 20kg) ;-)

I tried to download your auspost version from joomla extensions but i have vm 1.1.8 and when i tried uploading the patch, it said there was a version mismatch?
Read the rest of the instructions. For your version it tells you to install the module manually.. ;-)

Cheers

Mark
Title: Re: Simple AustraliaPost Shipping Module
Post by: Gippsweb on August 30, 2011, 00:35:29 am
Gidday to the Beardman,
I have just installed the mod_simpleaustraliapostcalculator_1.6.1.zip on my test site to use in my VM cart. I have enabled the module, set it position to the right and opened up my test website (local test site on my home computer, not the live website) and I have some errors.
Warning: explode() expects parameter 2 to be string, array given in C:\xampp\htdocs\cool\modules\mod_simple_australiapost_ecalculator\helper.php on line 408

Warning: urlencode() expects parameter 1 to be string, array given in C:\xampp\htdocs\cool\modules\mod_simple_australiapost_ecalculator\helper.php on line 534

Warning: explode() expects parameter 2 to be string, array given in C:\xampp\htdocs\cool\modules\mod_simple_australiapost_ecalculator\helper.php on line 413
There is one item in the shopping cart, it has a weight of 0.01kg.
Joomla version = 1.5.15
VirtueMart version = 1.1.7
Any help to resolve the errors would be appreciated please.


The Joomforge page only lists up to 1.5.9 where did you find this version??
Title: Re: Simple AustraliaPost Shipping Module
Post by: thebeardman on August 30, 2011, 08:53:56 am
Hi everyone,
Thanks to all for your posts, I see that my extensions are well used. I am sorry for not answering to all post but I do these developments on my free time.
Thanks to you Gippsweb for answering and understanding correctly the Simple AustraliaPost shipping.
I would also make it clear about this shipping module and other extensions. There are in fact two differents modules for the AustraliaPost.
I will make update to correct some bug and add new feature but you have to give me more time ;-)
Title: Re: Simple AustraliaPost Shipping Module
Post by: sandeepan512 on October 21, 2011, 13:42:25 pm
Hello,

What does this error means!!... I am just trying to figure out. Please it's an urgent issue.

Notice: Undefined variable: free_charge in /clientdata/zeus-dynamic-1/l/i/litelights.com.au/www/administrator/components/com_virtuemart/classes/shipping/simpleauspost.php on line 893

Notice: Undefined variable: free_charge in /clientdata/zeus-dynamic-1/l/i/litelights.com.au/www/administrator/components/com_virtuemart/classes/shipping/simpleauspost.php on line 893

Notice: Undefined index: Standard in /clientdata/zeus-dynamic-1/l/i/litelights.com.au/www/administrator/components/com_virtuemart/classes/shipping/simpleauspost.php on line 437

Notice: Undefined index: Standard in /clientdata/zeus-dynamic-1/l/i/litelights.com.au/www/administrator/components/com_virtuemart/classes/shipping/simpleauspost.php on line 438

Notice: Undefined index: Express in /clientdata/zeus-dynamic-1/l/i/litelights.com.au/www/administrator/components/com_virtuemart/classes/shipping/simpleauspost.php on line 437

Notice: Undefined index: Express in /clientdata/zeus-dynamic-1/l/i/litelights.com.au/www/administrator/components/com_virtuemart/classes/shipping/simpleauspost.php on line 438

Please guide me through.
Title: Re: Simple AustraliaPost Shipping Module
Post by: Das123 on October 28, 2011, 03:33:38 am
Australia Post has recently changed its 'calculate' API and while the old drc.edeliver.com.au url is supposed to work (which I believe this module uses) it seems that this is becoming more unstable and unsupported.

@sandeepan512: I would imagine this is the cause of the Undefined Variables notices. BTW, it is usually good practice to turn off PHP notices on live sites but to leave them on for development. While the errors should be fixed in the code, changing the notices setting in php.ini will at least hide them for you on your live site. As long as the module is still functioning correctly that is.  ;)

I have had to change the module code on a very old site to make use of the new API changes. I don't have time to look through this module but I think it will need to be upgraded to the new API fairly soon.

The new Australia Post API is more powerful and gives back much better data. Ultimately it could possibly be used to make this AustPost module much more interactive because it can be set to return all the allowable options given the various parameters such as the available services and the associated costs - all from a single call to the API.

Here is a snippet of the code I used in the old (2008) module to make use of the new API so I hope it is helpful:

Code: [Select]
// ...
function get_ship_type_cost($service){
global $total, $tax_total, $CURRENCY_DISPLAY, $Order_Pickup_Postcode, $Order_Destination_Postcode, $Order_Country, $Order_Weight, $Order_Length, $Order_Width, $Order_Height, $Order_Quantity, $Order_WeightKG, $classname, $Order_Handling_Fee;
// Collect variables into the query URI for Australia Post
// Make sure that you only pass a zip/postcode if it is inside Australia

if ( $Order_Country == "AU" ) {
// Domestic

// Example "https://auspost.com.au/api/postage/parcel/domestic/calculate?from_postcode=3000&to_postcode=4000&length=10&width=10&height=10&weight=10&service_code=AUS_PARCEL_REGULAR&option_code=AUS_SERVICE_OPTION_REGISTERED_POST&suboption_code=AUS_SERVICE_OPTION_EXTRA_COVER&extra_cover=3000"

$austpost_url = "https://auspost.com.au/api/postage/parcel/domestic/calculate.xml?"
."from_postcode=".$Order_Pickup_Postcode
."&to_postcode=".$Order_Destination_Postcode
."&length=".$Order_Length/10
."&width=".$Order_Width/10
."&height=".$Order_Height/10
."&weight=".$Order_Weight/1000
."&service_code=AUS_PARCEL_REGULAR"
;

} else {
// International

// "https://auspost.com.au/api/postage/parcel/international/calculate?country_code=TG&service_code=INTL_SERVICE_AIR_MAIL&option_code=INTL_SERVICE_OPTION_EXTRA_COVER&option_code=INTL_SERVICE_OPTION_CONFIRM_DELIVERY&weight=10&extra_cover=2000"

$get_string = "https://auspost.com.au/api/postage/parcel/international/calculate.xml?"
."country_code=".$Order_Country
."&weight=".$Order_Weight/1000
."&service_code=INTL_SERVICE_AIR_MAIL"
;

}

$auspost_xml = $this->get_auspost_api( $austpost_url );

$xml = simplexml_load_string($auspost_xml);

$APcharge = (float) $xml->total_cost;

if(!isset($xml->errorMessage)) {
$Total_Shipping_Handling = $APcharge + $Order_Handling_Fee;
$html .= "<!-- handling fee = $Order_Handling_Fee -->";
$_SESSION[$shipping_rate_id] = 1;

// THE ORDER OF THOSE VALUES IS IMPORTANT:
// ShippingClassName|carrier_name|rate_name|totalshippingcosts|rate_id
// Not happy with this line as I had to hardcode the classname for some reason.
// $shipping_rate_id = urlencode( $this->classname."|auspost|".$service."|".number_format($Total_Shipping_Handling,2));
$shipping_rate_id = urlencode( "auspost|auspost|".$service."|".number_format($Total_Shipping_Handling,2));

$html .= "\n<img src=\"/administrator/components/com_virtuemart/classes/shipping/images/auspost_".$service.".jpg\" alt=\"".$service." service\"><input type=\"radio\" name=\"shipping_rate_id\" id=\"auspost\" checked=\"checked\" value=\"$shipping_rate_id\" />\n";
$html .= "<label for=\"auspost_shipping_rate\">";
$html .= $CURRENCY_DISPLAY->getFullValue($Total_Shipping_Handling);
$html .= " (".$Order_WeightKG." kg) ".$xml->delivery_time;
$html .= "</label><br>";

$_SESSION[$shipping_rate_id] = 1;

echo $html;
return true;
}
else
{
$html .= "<label>Australia Post shipping calculator failed, reason: ".$xml->errorMessage."<br>";
echo $html;
return false;
}
}

function get_auspost_api($url) {
$crl = curl_init();
$timeout = 5;
curl_setopt ($crl, CURLOPT_HTTPHEADER, array('AUTH-KEY: {insert key here}'));
curl_setopt ($crl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($crl, CURLOPT_URL, $url);
curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
$ret = curl_exec($crl);
curl_close($crl);
return $ret;
}
// ...


The biggest downside to using the new API is that you need to apply for an AUTH-KEY from Australia Post as this needs to be placed in the headers that are sent to Australia Post. Without this you will get an error message. I guess the module would need a config setting for this key.

References:

http://auspost.com.au/devcentre/ (http://auspost.com.au/devcentre/)

http://auspost.com.au/devcentre/assets/pdfs/developer-centre-api-specification-for-pac-and-pcs-1.3-20110929.pdf (http://auspost.com.au/devcentre/assets/pdfs/developer-centre-api-specification-for-pac-and-pcs-1.3-20110929.pdf)

http://forums.whirlpool.net.au/archive/1770950 (http://forums.whirlpool.net.au/archive/1770950)
Title: Re: Simple AustraliaPost Shipping Module
Post by: TheRealDeal on February 28, 2012, 02:39:59 am
Has anyone upgraded this module to include the new (as of Sept 2011) Australia Post API.?

Das123 recommended that this would need to be done in his post on 27 October 2011 - so I am sure someone must have done it by now.

I am desperate to get my hands on the upgraded module if it exists.

Regards - Larry
Title: Re: Simple AustraliaPost Shipping Module
Post by: szacpp on March 24, 2012, 21:44:38 pm
Hello,

We have integrated this auspost module in our website but its not functioning, this is the error that we get when try to checkout

"Australia Post shipping calculator failed, reason: Please enter a valid From postcode. "

any help will be appreciated.

Thanks in advance
Title: Re: Simple AustraliaPost Shipping Module
Post by: GJC Web Design on May 04, 2012, 12:41:11 pm
The errors you are getting is because the old api is now being depreciated and there have been changes to it causing the old AusPost modules to fail.

I have written a complete new module that uses the new AusPost Postage Assessment Calculator (PAC) API and various other improvements.

Price is €30.

see here - http://www.gjcwebdesign.com/virtuemart-1.1-auspost-new-api-shipping-plugin.html (http://www.gjcwebdesign.com/virtuemart-1.1-auspost-new-api-shipping-plugin.html)

cheers