Jump to content



Latest News: (loading..)

Australian Shipping Module


  • Please log in to reply
3 replies to this topic

#1   ephestion

ephestion
  • Members
  • 35 posts
  • Real Name:Ephestion

Posted 30 May 2009 - 02:20 PM

Australia Post

Quote

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?

#2   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 30 May 2009 - 03:26 PM

View Postephestion, on May 31 2009, 12:20 AM, said:

Australia Post



Anyone know how to apply this for a version 3 AusPost module?
Just install the contribution.


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#3   ephestion

ephestion
  • Members
  • 35 posts
  • Real Name:Ephestion

Posted 01 June 2009 - 11:10 AM

View PostCoopco, on May 30 2009, 04:26 PM, said:

Just install the contribution.

i GET SQL ERRORS when i try to install it.

#4   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 01 June 2009 - 11:12 AM

View Postephestion, on Jun 1 2009, 09:10 PM, said:

i GET SQL ERRORS when i try to install it.
You mean the sql file does not work when you run it in phpmyadmin?


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.