Latest News: (loading..)
Sign in to follow this  
Followers 0
ephestion

Australian Shipping Module

4 posts in this topic

Australia Post

 

ACTIVATING THE DRC USING PHP 3 OR 4

 

If you use PHP scripting Version 3 OR 4, build the following code:

 

$myfile=file('http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode='.$var_pickup.'

&Destination_Postcode='.$var_destination.'&Country='.$var_country.'&Weight='.

$var_weight.'&Service_Type='.$var_service.'&Length='$var_length.'&Width='.

$var_width.'&Height='.$var_height.'&Quantity='.$var_quantity);

 

(Note: The box in grey should be built into one line)

 

Example

 

The PHP codes may look like the following:

 

$qs .= 'Height='.$HTTP_POST_VARS["Height"].'&';

$qs .= 'Length='.$HTTP_POST_VARS["Length"].'&';

$qs .= 'Width='.$HTTP_POST_VARS["Width"].'&';

$qs .= 'Weight='.$HTTP_POST_VARS["Weight"].'&';

$qs .= 'Pickup_Postcode='.$HTTP_POST_VARS["Pickup_Postcode"].'&';

$qs .= 'Destination_Postcode='.$HTTP_POST_VARS["Destination_Postcode"].'&';

$qs .= 'Country='.$HTTP_POST_VARS["Country"].'&';

$qs .= 'Service_Type='.$HTTP_POST_VARS["Service_Type"].'&';

$qs .= 'Quantity='.$HTTP_POST_VARS["Quantity"]; .

 

back to top

 

 

 

 

 

ACCESSING THE RATE CALCULATOR ON AUSTRALIA POST EDELIVER WEBSITE

 

Post the following values to:

 

http://drc.edeliver.com.au/ratecalc.asp

 

Programs needs to perform an http request on this page with the following values

 

Pickup_Postcode=<string: 4 chars>

Destination_Postcode=<string: 4 chars>

Country=<string: 2 chars>

Weight=<integer>

Service_Type=<'STANDARD','EXPRESS','AIR','SEA','ECONOMY'>

Length=<integer>

Width=<integer>

Height=<integer>

Quantity=<integer>

 

 

 

back to top

 

 

GETTING THE RESULTS

 

When you execute the $myfile=file('http://drc.edeliver.com.au/ratecalc.asp?'.$qs); the results returned are placed into an array called $myfile. The name/value pairs of the results are returned on separate lines, so what you end up with is an array with three elements, which would look like:

 

charge=2.50

days=1

err_msg=OK

 

The last component contains error messages to inform customers they have made errors when entering the data (e.g. Invalid weight). Displaying the error helps to prompt customers to re-enter required information.

 

Displaying the results on your website

 

Depending on your Web page design, it is up to you how to display the results of the delivery charge estimation to your customers. You will be able to select what information you want displayed in a format you prefer.

 

You can use PHP's split ( ) function to retrieve the values returned.

 

Example

 

$x = split('=',$myfile[0])

 

This splits the first line into items separated by the '=' sign, resulting in an array called $x with values:

 

$x[0] = "charge" and $x[1] = 2.74

 

echo "The charge is $".$x[1];

 

Similarly, you are able to split on the next two lines ( $myfile[1] and $myfile[2] )

 

Anyone know how to apply this for a version 3 AusPost module?

Share this post


Link to post
Share on other sites
Australia Post

 

 

 

Anyone know how to apply this for a version 3 AusPost module?

Just install the contribution.

Share this post


Link to post
Share on other sites
i GET SQL ERRORS when i try to install it.

You mean the sql file does not work when you run it in phpmyadmin?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0