Jump to content
Sign in to follow this  
smithkyle1992

Split Shipping Into Multiple Packages If Over Weight Limit

Recommended Posts

Surly someone out there knows something?

I don't know why it does work for you.

 

I have my max shipping weight set at 10kg, but if I place an order that is 33kg, it still calculates it.

 

If you do not have your package sizes set, it will not know how to split it up.


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.

Share this post


Link to post
Share on other sites

It's easy. In admin configuration there is a default shipping/pacakging setting.

 

There if you set the maximum weight of the package you will ship is 20kgs, then it will split automatically.

 

I am using creloaded version Oscommerce. I am not sure if you can set this from your admin.

 

Hi,

I have installed the Auspost contribution (http://www.oscommerce.com/community/contributions,648) however currently if the shipping is over the weight limit (20KG) then the option to use auspost does not show up.

Is there some way of making the module split the package into multiple shipments and calculating multiple shipments?

Thanks

Kyle

Share this post


Link to post
Share on other sites

hmmm, strange, what version/contribution for auspost are you using, i have the max set to 20kgs (ausposts max) but when it goes over that 20kg it doesnt display the postage method, if increase above 20kgs i get an error message (please contact your store owner)

Share this post


Link to post
Share on other sites
hmmm, strange, what version/contribution for auspost are you using, i have the max set to 20kgs (ausposts max) but when it goes over that 20kg it doesnt display the postage method, if increase above 20kgs i get an error message (please contact your store owner)

From memory

 

AusPOST v2.0.2 - Update and AusPOST v2.0.2

 

Have changed the wording in the laguage files to suit myself.


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.

Share this post


Link to post
Share on other sites

Hmmm... interesting.... i rolled back to v2.0.2 but i got the following error message:

ERROR: The delivery rate for this option cannot be determined at this time

If you prefer to use this option as your shipping method, please contact the store owner.

 

Can i get a copy of your auspost.php file?

Share this post


Link to post
Share on other sites
Hmmm... interesting.... i rolled back to v2.0.2 but i got the following error message:

ERROR: The delivery rate for this option cannot be determined at this time

If you prefer to use this option as your shipping method, please contact the store owner.

 

Can i get a copy of your auspost.php file?

ERROR: The delivery rate for this option cannot be determined at this time

If you prefer to use this option as your shipping method, please contact the store owner.

 

The above is the normal error message that you get if the drc is unavailable.

 

<?php
/*
 $Id: auspost.php,v 2.0.2 2003/10/15

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License

 Modified by Coopco Pty Ltd 2005
 Australia POST Parcel Post
*/

 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;

     $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;

     $insurance_table = split("[:,]" , MODULE_SHIPPING_AUSPOST_INSURANCE);
       for ($i = 0; $i < count($insurance_table); $i+=2) {
         if ($cart->show_total() <= $insurance_table[$i]) {
           $insurance = $insurance_table[$i+1];
           $insurance_details = " $" .$insurance . " " .MODULE_SHIPPING_AUSPOST_TEXT_INSURANCE;
           break;
         }
       }
       $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";
       $myfile = file($url);
       foreach($myfile as $vals)
       {
               $bits = split("=", $vals);
               $$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;

     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 ('Insurance', 'MODULE_SHIPPING_AUSPOST_INSURANCE', '', 'Domestic mail is only insured if it is Registered. We do not offer Registered Parcels.', '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 ('Dispatch Postcode', 'MODULE_SHIPPING_AUSPOST_SPCODE', '3196', '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, date_added) values ('Handling Fee', 'MODULE_SHIPPING_AUSPOST_HANDLING', '1.45', '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 ('Parcel Height', 'MODULE_SHIPPING_AUSPOST_SHEIGHT', '370', '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', 'MODULE_SHIPPING_AUSPOST_SWIDTH', '405', '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', 'MODULE_SHIPPING_AUSPOST_SDEPTH', '75', '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_INSURANCE', 'MODULE_SHIPPING_AUSPOST_SPCODE', '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');
   }
 }
?>


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.

Share this post


Link to post
Share on other sites

Thanks, i tried you script and i still got that error message oO.........

Can you confirm that adding over 20kg works for me?

I really need to get this working!

Share this post


Link to post
Share on other sites
Thanks, i tried you script and i still got that error message oO.........

Can you confirm that adding over 20kg works for me?

I really need to get this working!

 

Yes mine works.

 

In admin, I have in

Shipping/Packaging

 

Title Value Action

Country of Origin Australia

Postal Code 3196

Enter the Maximum Package Weight you will ship 10

Package Tare weight. 0.080

Larger packages - percentage increase. 10


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.

Share this post


Link to post
Share on other sites
Thanks, i tried you script and i still got that error message oO.........

Can you confirm that adding over 20kg works for me?

I really need to get this working!

Is osc on your pc or on the web?

 

Does the module work with smaller packages?


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.

Share this post


Link to post
Share on other sites
Is osc on your pc or on the web?

 

Does the module work with smaller packages?

 

Yes, no orders are treated as real yet so feel free to play around with it, www.wstech.com.au/catalog, shipping works for when the items add up to a weight of less then 20kgs but not over!

Share this post


Link to post
Share on other sites
Yes, no orders are treated as real yet so feel free to play around with it, www.wstech.com.au/catalog, shipping works for when the items add up to a weight of less then 20kgs but not over!

Ok, for under 20kg it seems to work, for over 20 kg it cannot determine the postage.

 

I think that it cannot determine how to split the package because it has not got dimensions to deal with.

 

In admin, I have used the package size that I will use

 

Enable auspost

True

 

Insurance

 

 

Dispatch Postcode

3196

 

Handling Fee

2.27

 

Parcel Height

370

 

Parcel Width

405

 

Parcel Depth

75

 

Shipping Zone

Australian Zones

 

Tax Class

GST

 

Sort order of display.

10

 

This is a bit harder for you to set up because of the products you sell. There are also size limitations on what Australia Post will deliver (eg large monitors).

 

My guess is that you will have to set up a number options using zone rates, table rates, private couriers, and ..... I don't know.


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.

Share this post


Link to post
Share on other sites

Ok, here is a new idea, is there a module that will allow me to go for this postcodes starting with x, between this and this weight cost x plus insurance x plus P&H x?

Thanks

Share this post


Link to post
Share on other sites
Is there a contribution that will allow me to have the dimensions dynamicaly set per item?

Not that I am aware of.


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.

Share this post


Link to post
Share on other sites
Ok, here is a new idea, is there a module that will allow me to go for this postcodes starting with x, between this and this weight cost x plus insurance x plus P&H x?

Thanks

I see waht you mean, but I don't think it has been done.

 

You should check what shipping methods your competitors are using.


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.

Share this post


Link to post
Share on other sites

Competitors all seem to have a flat rate for each state...... This would be alright, but i'd still want weight to play some part in determining the final price like for victoria 1-25kg - $20, 25-40kg - $35 then again different prices for the other states, is this possiable?

Share this post


Link to post
Share on other sites
Competitors all seem to have a flat rate for each state...... This would be alright, but i'd still want weight to play some part in determining the final price like for victoria 1-25kg - $20, 25-40kg - $35 then again different prices for the other states, is this possiable?

Definitely. You can use zones rate, and/or some of the flat rate modules. You would need to divide Oz into zones.


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.

Share this post


Link to post
Share on other sites

Yep.... what i really need is a table contribution like the one that comes preinstalled but with the ability to set multiple zones, in the one tyhat comes with oscommerce you can only set 1 zone, any suggestions on what to use?

Share this post


Link to post
Share on other sites

Ok, found what i was looking for, good contribution for anyone else interested.... its the Table with Flat State Fee Addon Shipping Module. Did almost exacly what i wanted, it enabled me to set a base charge and then add an extra onto other states.

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  

×