Author Topic: Simple AustraliaPost Shipping Module  (Read 68237 times)

freshweb

  • Beginner
  • *
  • Posts: 36
Re: Simple AustraliaPost Shipping Module
« Reply #60 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

thebeardman

  • Jr. Member
  • **
  • Posts: 54
  • Touch a thread and all the Web comes alive!
    • My Joomla forge Page
Re: Simple AustraliaPost Shipping Module
« Reply #61 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

aquapixel

  • Beginner
  • *
  • Posts: 8
Re: Simple AustraliaPost Shipping Module
« Reply #62 on: April 15, 2011, 12:37:54 pm »
Thanks thebeardman,

I'll look out for your next release!

Cheers:)

ps4u

  • Beginner
  • *
  • Posts: 7
Re: Simple AustraliaPost Shipping Module
« Reply #63 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

thebeardman

  • Jr. Member
  • **
  • Posts: 54
  • Touch a thread and all the Web comes alive!
    • My Joomla forge Page
Re: Simple AustraliaPost Shipping Module
« Reply #64 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.

grzx

  • Beginner
  • *
  • Posts: 1
Re: Simple AustraliaPost Shipping Module
« Reply #65 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?

Dog_Guy

  • Jr. Member
  • **
  • Posts: 105
    • Dog walker & Pet Sitting Melbourne
Re: Simple AustraliaPost Shipping Module
« Reply #66 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?
You can buy healthy dog treats from either of my sites: http://www.dogwalkersmelbourne.com.au/ or http://www.healthydogtreats.com.au/

Dog_Guy

  • Jr. Member
  • **
  • Posts: 105
    • Dog walker & Pet Sitting Melbourne
Re: Simple AustraliaPost Shipping Module
« Reply #67 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?
You can buy healthy dog treats from either of my sites: http://www.dogwalkersmelbourne.com.au/ or http://www.healthydogtreats.com.au/

Cheetaa

  • Beginner
  • *
  • Posts: 5
Re: Simple AustraliaPost Shipping Module
« Reply #68 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.

luana_r801

  • Beginner
  • *
  • Posts: 1
Re: Simple AustraliaPost Shipping Module
« Reply #69 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

Gippsweb

  • Beginner
  • *
  • Posts: 25
    • Wots I.T.?
Re: Simple AustraliaPost Shipping Module
« Reply #70 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

Gippsweb

  • Beginner
  • *
  • Posts: 25
    • Wots I.T.?
Re: Simple AustraliaPost Shipping Module
« Reply #71 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??

thebeardman

  • Jr. Member
  • **
  • Posts: 54
  • Touch a thread and all the Web comes alive!
    • My Joomla forge Page
Re: Simple AustraliaPost Shipping Module
« Reply #72 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.
  • The first one (as Gippsweb is talking about) is used by VirtueMart on the checkout and has to be installed manually (or automatically withH the VirtueMart update)
  • The second one (and it's the one Cheetah is talking about) is an usual Joomla module extension. Of course it needs to have VirtueMart installed to work properly. This module is useful to display a preview shipping cost when a customer is shopping on your website.
I will make update to correct some bug and add new feature but you have to give me more time ;-)

sandeepan512

  • Beginner
  • *
  • Posts: 1
Re: Simple AustraliaPost Shipping Module
« Reply #73 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.

Das123

  • Beginner
  • *
  • Posts: 21
    • Design Solutions - Creative Consultancy & Studio
Re: Simple AustraliaPost Shipping Module
« Reply #74 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/assets/pdfs/developer-centre-api-specification-for-pac-and-pcs-1.3-20110929.pdf

http://forums.whirlpool.net.au/archive/1770950