Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shipping Zones & Rates For Australia


jetskeem

Recommended Posts

Posted

Hi people,

 

Have been having trouble with trying to find shipping modules for Australia and to ship overseas. I basically want something that will allow me to insert rates for a product up to a certain weight. e.g Up to 250g, a set rate within Australia or to certain overseas zones, up to 500g, another set rate within Australia or overseas zones, etc.

 

I don't want a set rate per order, and if possible, is there a way to combine postage for multiple items purchased instead of charging a customer postage per item which can be quite expensive for them.

 

Is there someone out there that can help or at least guide me in the right direction toward some editing of the UPS module or a module for the Australian market?

 

Hekp would be greatly appreciated.

 

Regards,

 

Norman :blink:

Posted

 

Hi MME,

 

Thanks for the reply. I downloaded the Australia Post module, and when I install it into the shipping module, I come up with these errors:

 

Warning: include(/var/virtual/web//html/shop//includes/languages/english/modules/shipping/auspost.php) [function.include]: failed to open stream: No such file or directory in /var/virtual/web//html/shop/admin/modules.php on line 128

 

Warning: include() [function.include]: Failed opening '/var/virtual/web//html/shop//includes/languages/english/modules/shipping/auspost.php' for inclusion (include_path='.:') in /var/virtual/web//html/shop/admin/modules.php on line 128

 

I can only seem to get one zone (Australia)

 

I would like to be able to say:

 

Zone 1 (Australia) : 0-250g $7.00 postage inclusive of registration; 250g-500g $9.00 postage inclusive of registration; etc

Zone 2 (New Zealand): 0-250g $10.00 postage inclusive of insurance; 250g-500g $13.00 postage inclusive of insurance; etc

Zone 3 (Singapore,Malaysia,HongKong, etc) 0-250g $13.00 postage inclusive of insurance; 250g-500g $16.00 postage inclusice of insurance; etc

Zone 4 (USA,Canada) 0-250g $16.00 inclusive of insurance; 250g-500g $18.00 inclusive of insurance; etc

Zone 5 (UK, Europe, South America, South Africa) 0-250g $19.00 inclusive of insurance; 205g-500g $22.00 inclusive of insurance; etc

 

I would like to be able to insert the above figures into the aust post module, but have no idea how to.

 

Any help would be greatful.

 

Regards,

 

Norman

Posted
Hi MME,

 

Thanks for the reply. I downloaded the Australia Post module, and when I install it into the shipping module, I come up with these errors:

 

Warning: include(/var/virtual/web//html/shop//includes/languages/english/modules/shipping/auspost.php) [function.include]: failed to open stream: No such file or directory in /var/virtual/web//html/shop/admin/modules.php on line 128

 

Warning: include() [function.include]: Failed opening '/var/virtual/web//html/shop//includes/languages/english/modules/shipping/auspost.php' for inclusion (include_path='.:') in /var/virtual/web//html/shop/admin/modules.php on line 128

 

I can only seem to get one zone (Australia)

 

I would like to be able to say:

 

Zone 1 (Australia) : 0-250g $7.00 postage inclusive of registration; 250g-500g $9.00 postage inclusive of registration; etc

Zone 2 (New Zealand): 0-250g $10.00 postage inclusive of insurance; 250g-500g $13.00 postage inclusive of insurance; etc

Zone 3 (Singapore,Malaysia,HongKong, etc) 0-250g $13.00 postage inclusive of insurance; 250g-500g $16.00 postage inclusice of insurance; etc

Zone 4 (USA,Canada) 0-250g $16.00 inclusive of insurance; 250g-500g $18.00 inclusive of insurance; etc

Zone 5 (UK, Europe, South America, South Africa) 0-250g $19.00 inclusive of insurance; 205g-500g $22.00 inclusive of insurance; etc

 

I would like to be able to insert the above figures into the aust post module, but have no idea how to.

 

Any help would be greatful.

 

Regards,

 

Norman

You are talking about a zone rate module.

 

The aust shipping module does not work like that.

It sounds like you missed copying all files to the website. You should have two shipping zones, one is australia, the other is the rest of the world. The sql does this for you.

Posted
You are talking about a zone rate module.

 

The aust shipping module does not work like that.

It sounds like you missed copying all files to the website. You should have two shipping zones, one is australia, the other is the rest of the world. The sql does this for you.

 

Hi,

 

I've just reinstalled the total auspost file to the website (i.e. auspost, auspostair, auspostexpress, auspostsea, insuredauspost, inusredauspostair, insuredauspostexpress, insuredauspostsea .php documents in their entirety TO "/shop/includes/modules/shipping/" AND "/shop/catalog/includes/languages/english/modules/shipping/" and I am getting the following error:

 

Fatal error: Cannot redeclare class auspost in /var/virtual/web//html/shop/includes/modules/shipping/auspost.php on line 17

 

 

This is the auspost.php file below as downloaded and installed into my oscommerce site.

 

Help on this would be greatly appreciated.

 

Regards,

 

Norman

 

 

 

<?php

/*

$Id: auspost.php,v 3.0.1 July 1st 2007

Contribution updated to :

Remove obsolete module

Fix bug which prevented some postcode calculations being performed

Allow use of both insured and uninsured parcels

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2007 osCommerce

 

Released under the GNU General Public License

*/

 

class auspost {

var $code, $title, $description, $icon, $enabled;

 

// class constructor

function auspost() {

global $order;

 

$this->code = 'auspost';

$this->title = MODULE_SHIPPING_AUSPOST_TEXT_TITLE;

$this->description = MODULE_SHIPPING_AUSPOST_TEXT_DESCRIPTION;

$this->sort_order = MODULE_SHIPPING_AUSPOST_SORT_ORDER;

$this->icon = DIR_WS_ICONS . 'auspost.gif';

$this->tax_class = MODULE_SHIPPING_AUSPOST_TAX_CLASS;

$this->enabled = ((MODULE_SHIPPING_AUSPOST_STATUS == 'True') ? true : false);

 

if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_AUSPOST_ZONE > 0) ) {

$check_flag = false;

$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_AUSPOST_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");

while ($check = tep_db_fetch_array($check_query)) {

if ($check['zone_id'] < 1) {

$check_flag = true;

break;

} elseif ($check['zone_id'] == $order->delivery['zone_id']) {

$check_flag = true;

break;

}

}

 

if ($check_flag == false) {

$this->enabled = false;

}

}

}

 

// class methods

function quote($method = '') {

global $order, $cart, $shipping_weight, $shipping_num_boxes, $total_weight;

 

// AUS ONLY Other countries HIDE

if ($order->delivery['country']['iso_code_2'] == 'AU') {

 

// ONLY SHOWN IF LESS OR EQUAL TO MAX WEIGHT

if ($shipping_weight <= MODULE_SHIPPING_AUSPOST_MAX_WEIGHT) {

 

$frompcode = MODULE_SHIPPING_AUSPOST_SPCODE;

$topcode = $order->delivery['postcode'];

$sweight = $shipping_weight*1000;

$swidth = MODULE_SHIPPING_AUSPOST_SWIDTH;

$sheight = MODULE_SHIPPING_AUSPOST_SHEIGHT;

$slength = MODULE_SHIPPING_AUSPOST_SDEPTH;

$error = false;

 

// If Insurance option selected - calculate insurance cost

if (MODULE_SHIPPING_AUSPOST_INS_STATUS == 'True') {

// Start with Base Cost

$insurance = MODULE_SHIPPING_AUSPOST_INS_BASE ;

if ($order->info['subtotal'] > MODULE_SHIPPING_AUSPOST_INS_UNIT) {

$how_often = ceil((($order->info['subtotal'] - MODULE_SHIPPING_AUSPOST_INS_UNIT)/MODULE_SHIPPING_AUSPOST_INS_UNIT));

$insurance =+ MODULE_SHIPPING_AUSPOST_INS_BASE + ($how_often * MODULE_SHIPPING_AUSPOST_INS_ADD) ;

}

}

// End calculating Insurance

 

/**

* Initialize the cURL session

*/

$ch = curl_init();

/**

* Set the URL of the page or file to download.

*/

curl_setopt($ch, CURLOPT_URL,

"http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=$frompcode&Destination_Postcode=$topcode&Country=AU&Weight=$sweight&Service_Type=STANDARD&Height=$sheight&Width=$swidth&Length=$slength&Quantity=$shipping_num_boxes");

/**

* Ask cURL to return the contents in a variable

* instead of simply echoing them to the browser.

*/

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

/**

* Execute the cURL session

*/

$contents = curl_exec ($ch);

/**

* Close cURL session

*/

curl_close ($ch);

{

$bits = split("=" ,$contents);

$$bits[0] = $bits[1];

}

 

if ($charge <= 0) {

$error = true;

} else {

 

$handling = MODULE_SHIPPING_AUSPOST_HANDLING;

if ($handling >0) {

$handling_details = " $" . MODULE_SHIPPING_AUSPOST_HANDLING . " " .MODULE_SHIPPING_AUSPOST_TEXT_HANDLING;

} else {

$handling_details = "";

}

 

if ($insurance >0) {

$insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_TEXT_INSURANCE;

} else {

$insurance_details = "";

}

 

if ($insurance == 0 && $handling == 0) {

$auspost_addons = "";

} else {

$auspost_addons = " (" . MODULE_SHIPPING_AUSPOST_TEXT_INCLUDE . $handling_details . $insurance_details . ") ";

}

 

$shipping_auspost_method = MODULE_SHIPPING_AUSPOST_TEXT_WAY. " <b>" . $topcode . "</b> - " . $days . " " . MODULE_SHIPPING_AUSPOST_TEXT_SHIPPINGDAYS . "<br>" .$shipping_num_boxes . " " .MODULE_SHIPPING_AUSPOST_TEXT_BOXES . " " . $total_weight . MODULE_SHIPPING_AUSPOST_TEXT_UNITS . $auspost_addons;

$shipping_auspost_cost = (($charge/1.1)* $shipping_num_boxes);

}

 

$this->quotes = array('id' => $this->code,

'module' => MODULE_SHIPPING_AUSPOST_TEXT_TITLE,

'methods' => array(array('id' => $this->code,

'title' => $shipping_auspost_method,

'cost' => ($shipping_auspost_cost + MODULE_SHIPPING_AUSPOST_HANDLING) + $insurance)));

 

if ($this->tax_class > 0) {

$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

}

 

if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

 

if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_AUSPOST_TEXT_ERROR . " " . $total_weight . " " . $shipping_weight ;

 

return $this->quotes;

}

}

}

 

function check() {

if (!isset($this->_check)) {

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_AUSPOST_STATUS'");

$this->_check = tep_db_num_rows($check_query);

}

return $this->_check;

}

 

function install() {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable auspost', 'MODULE_SHIPPING_AUSPOST_STATUS', 'True', 'Do you want to offer auspost?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Dispatch Postcode', 'MODULE_SHIPPING_AUSPOST_SPCODE', '2000', 'Dispatch Postcode?', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Insurance', 'MODULE_SHIPPING_AUSPOST_INS_STATUS', 'True', 'Do you want to include insurance?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Insurance Base Cost', 'MODULE_SHIPPING_AUSPOST_INS_BASE', '4.35', 'Cost for the first unit of insurance. Needs to be sent <b>Registered Mail</b> for Insurance.', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Insurance Addition Cost', 'MODULE_SHIPPING_AUSPOST_INS_ADD', '1.15', 'Cost for each addition unit of insurance over Base Cost.', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Insurance Unit Size', 'MODULE_SHIPPING_AUSPOST_INS_UNIT', '100', 'Insurance units are based on these increments - (size in Dollars).', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_AUSPOST_HANDLING', '5.00', 'Handling Fee for this shipping method', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Maximum Weight (kg)', 'MODULE_SHIPPING_AUSPOST_MAX_WEIGHT', '20', 'Maximum weight allowed by AustPost (in kg). A packaging allowance of <b>3 kg</b> is allowed. EG. 20 - 3 = 17. 17 becomes cutoff point for use.', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Height (mm)', 'MODULE_SHIPPING_AUSPOST_SHEIGHT', '100', 'Parcel Height (in mm)', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Width (mm)', 'MODULE_SHIPPING_AUSPOST_SWIDTH', '100', 'Parcel Width (in mm)', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Parcel Depth (mm)', 'MODULE_SHIPPING_AUSPOST_SDEPTH', '100', 'Parcel Depth (in mm)', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_AUSPOST_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_AUSPOST_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_AUSPOST_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

 

function keys() {

return array('MODULE_SHIPPING_AUSPOST_STATUS', 'MODULE_SHIPPING_AUSPOST_SPCODE','MODULE_SHIPPING_AUSPOST_INS_STATUS', 'MODULE_SHIPPING_AUSPOST_INS_BASE', 'MODULE_SHIPPING_AUSPOST_INS_ADD', 'MODULE_SHIPPING_AUSPOST_INS_UNIT', 'MODULE_SHIPPING_AUSPOST_MAX_WEIGHT', 'MODULE_SHIPPING_AUSPOST_HANDLING', 'MODULE_SHIPPING_AUSPOST_SHEIGHT', 'MODULE_SHIPPING_AUSPOST_SWIDTH', 'MODULE_SHIPPING_AUSPOST_SDEPTH', 'MODULE_SHIPPING_AUSPOST_ZONE', 'MODULE_SHIPPING_AUSPOST_TAX_CLASS', 'MODULE_SHIPPING_AUSPOST_SORT_ORDER', );

}

}

?>

Posted

Try giving each module a unique sort order above zero.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...