Post by ozstar » Sun Sep 09, 2012 8:20 am

Hi,

Well finally got the time to get this.. Hope it is not too complicated.

Really appreciate the help and guess a lot of others will as well, as anything small will come into these categories not just CD/DVDs.

oz

Some CDs are slimline and others have 2CDs in the case thus the weight variation.
DVD's are roughly within the same weight range

All are within Australia doesn't matter about zip code.

1 CD weighs
From 66g to 105g which falls into the 50g To 125g category
The bag size is roughly C5 size 162mm X 229mm falling into 5 to 20 mm thick category
Aust Post is $1.20. Express post $5.25

2 CDs weigh
From 142 to 201g which falls into the 125g To 250g category
The bag size is roughly C4 size 324mm X 229mm falling into 5 to 20 mm thick category
Aust Post is $ 1.80. Express post $6.65

3 CDs weigh
Up to 281g which falls into the 250g To 500g category
The bag size is roughly C4 size 324mm X 229mm falling into 5 to 20 mm thick category
Aust Post is $ 3.00. Express post $6.65

4 CDs weigh
Up to 357g which falls into the 250g To 500g category
The bag size is roughly C4 size 324mm X 229mm falling into 5 to 20 mm thick category
Aust Post is $ 3.00. Express post $6.65

5 CDs weigh
Up to 433g which falls into the 250g To 500g category
The bag size is roughly C4 size 324mm X 229mm or B4 size 353mmx250mm falling into 5 to 20 mm thick category
Aust Post is $ 3.00. Express post $6.65

OVER 5 CDs is just over 500g letter limit

The Australian Post web site calculator states this..

A standard letter has to be 5 mm max thick
A standard letter has to be under 250gms

A large letter is from 5mm to max 20mm thick
A large letter max size is 260mm x 360mm
A large letter has to be under 500gms

Aust Post prices for letters are..

$1.20 - $1.80 - $3.00

Active Member

Posts

Joined
Fri Mar 09, 2012 7:47 am
Location - Sydney OZ

Post by philbydevil » Sun Sep 09, 2012 8:22 am

@bronts

Not sure why you're getting those errors in weight.php and length.php, and the one in auspost.php is nowhere near the code changes that I suggested....

Try going back to the original code and see if you still get the errors.

Did you input the weight and length correctly in admin? 20g should be 0.02 and the lengths should be 0.32 , etc. With no "g" or "mm" typed in there.

I don't use dimensions for any of my products. Try going back to 0 for the dimensions as well and see how it goes.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Sun Sep 09, 2012 8:38 am

Try this oz:

Open catalog/model/shipping/auspost.php:

FIND (right down the bottom of the file):

Code: Select all

	private function getAuspostSatchel($service, $weight) {
		//Define the different satchel sizes / prices (0 represents unavailable) - Updated July 2011
      		$satchel = array("satchreg" => array(0 => 6.60, 1 => 11.20, 2 => 0),
                       		 "satchexp" => array(0 => 9.20, 1 => 12.55, 2 => 20.85),
                       		 "satchpla" => array(0 => 13.40, 1 => 17.70, 2 => 0));

		//Default to return 0
		$satch_quote = 0;

		if($weight <= 500) { $satch_quote = $satchel[$service][0];}
		if(($weight > 500) && ($weight <= 3000)) { $satch_quote = $satchel[$service][1];}
		if(($weight > 3000) && ($weight <=5000)) { $satch_quote = $satchel[$service][2];}
CHANGE TO:

Code: Select all

	private function getAuspostSatchel($service, $weight) {
		//Define the different satchel sizes / prices (0 represents unavailable) - Updated July 2011
      		$satchel = array("satchreg" => array(0 => 1.20, 1 => 1.80, 2 => 3.00, 3 => 11.20, 4 => 14.50),
                       		 "satchexp" => array(0 => 5.25, 1 => 6.65, 2 => 6.65, 3 => 12.55, 4 => 20.85),
                       		 "satchpla" => array(0 => 0, 1 => 0, 2 => 0, 3 => 17.70, 4 => 0));

		//Default to return 0
		$satch_quote = 0;

		if($weight <= 125) { $satch_quote = $satchel[$service][0];}
                if(($weight > 125) && ($weight <= 250)) { $satch_quote = $satchel[$service][1];}
                if(($weight > 250) && ($weight <= 500)) { $satch_quote = $satchel[$service][2];}
		if(($weight > 500) && ($weight <= 3000)) { $satch_quote = $satchel[$service][3];}
		if(($weight > 3000) && ($weight <=5000)) { $satch_quote = $satchel[$service][4];}
I don't bother with any dimensions for my products (in admin).

Back up your files before trying this. I haven't actually tested it but it's based on what I did here: http://forum.opencart.com/viewtopic.php ... 80#p242438 to add heavier satchels so it should work.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by ozstar » Sun Sep 09, 2012 8:51 am

Thanks.. Will give it a shot....

oz

Active Member

Posts

Joined
Fri Mar 09, 2012 7:47 am
Location - Sydney OZ

Post by ozstar » Sun Sep 09, 2012 8:58 am

Hi,

This is what i have in my /public_html/open/catalog/model/shipping.

Still replace this with yours?

oz

Code: Select all

private function getAuspostSatchel($service, $weight) {
		//Define the different satchel sizes / prices (0 represents unavailable) - Updated April 2012
      		$satchel = array("satchreg" => array(0 => 7.20, 1 => 11.40, 2 => 14.50),
				 "satcheby" => array(0 => 6.20, 1=> 10.55, 2=> 0),
                       		 "satchexp" => array(0 => 9.55, 1 => 13.05, 2 => 21.65),
                       		 "satchpla" => array(0 => 13.90, 1 => 18.35, 2 => 0));

		//Default to return 0
		$satch_quote = 0;

		if($weight <= 500) { $satch_quote = $satchel[$service][0];}
		if(($weight > 500) && ($weight <= 3000)) { $satch_quote = $satchel[$service][1];}
		if(($weight > 3000) && ($weight <=5000)) { $satch_quote = $satchel[$service][2];}

		//Added > 0 check to ensure handling wasn't added if no satchel was suitable
                if ((floatval($this->config->get('auspost_handling')) > 0) && $satch_quote > 0 ) {
                	$satch_quote = sprintf('%.2f', $satch_quote + floatval($this->config->get('auspost_handling')));
                }

		if ($this->config->get('auspost_stripgst')) {$satch_quote = (($satch_quote / 11) * 10);}

		return $satch_quote;
	}
}
?>

Active Member

Posts

Joined
Fri Mar 09, 2012 7:47 am
Location - Sydney OZ

Post by bronts » Sun Sep 09, 2012 9:12 am

Hi, It didn't work.
I put back the commercial AusPost module so I can keep on testing etc).

No Matter, I'll just look for someone whom I can pay to add in the other available options.
Oh, would you be willing to take it on or can you direct me to someone who might?
I am willing to pay.

I very much appreciate your helping though - thank you!

Bronte

User avatar
Active Member

Posts

Joined
Sat Jul 14, 2012 12:56 pm
Location - QLD Australia

Post by philbydevil » Sun Sep 09, 2012 9:30 am

Try this ozstar (and maybe bronts too):

Code: Select all

private function getAuspostSatchel($service, $weight) {
      //Define the different satchel sizes / prices (0 represents unavailable) - Updated April 2012
            $satchel = array("satchreg" => array(0 => 1.20, 1 => 1.80, 2 => 3.00, 3 => 11.40, 4 => 14.50),
                              "satcheby" => array(0 => 1.20, 1 => 1.80, 2 => 6.20, 3 => 10.55, 4 => 14.50),
                              "satchexp" => array(0 => 5.25, 1 => 6.65, 2 => 6.55, 3 => 13.05, 4 => 21.65),
                              "satchpla" => array(0 => 0, 1 => 0, 2 => 13.90, 3 => 18.35, 4 => 0));

      //Default to return 0
      $satch_quote = 0;

      if($weight <= 125) { $satch_quote = $satchel[$service][0];}
      if(($weight > 125) && ($weight <= 250)) { $satch_quote = $satchel[$service][1];}
      if(($weight > 250) && ($weight <= 500)) { $satch_quote = $satchel[$service][2];}
      if(($weight > 500) && ($weight <= 3000)) { $satch_quote = $satchel[$service][3];}
      if(($weight > 3000) && ($weight <=5000)) { $satch_quote = $satchel[$service][4];}

      //Added > 0 check to ensure handling wasn't added if no satchel was suitable
                if ((floatval($this->config->get('auspost_handling')) > 0) && $satch_quote > 0 ) {
                   $satch_quote = sprintf('%.2f', $satch_quote + floatval($this->config->get('auspost_handling')));
                }

      if ($this->config->get('auspost_stripgst')) {$satch_quote = (($satch_quote / 11) * 10);}

      return $satch_quote;
   }
}
?>
I possibly have an older version of the module as I can see what looks like an ebay satchel in your code which I don't have.

Maybe that's why you were having errors bronts.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Sun Sep 09, 2012 9:34 am

bronts wrote:Hi, It didn't work.
I put back the commercial AusPost module so I can keep on testing etc).

No Matter, I'll just look for someone whom I can pay to add in the other available options.
Oh, would you be willing to take it on or can you direct me to someone who might?
I am willing to pay.

I very much appreciate your helping though - thank you!

Bronte
What didn't work exactly? Did you try just using this AusPost straight out of the box without any editing? Did that work?

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by bronts » Sun Sep 09, 2012 9:38 am

I'll try it when I get back - I have to take off for an hr.
ty

Bronte

User avatar
Active Member

Posts

Joined
Sat Jul 14, 2012 12:56 pm
Location - QLD Australia

Post by philbydevil » Sun Sep 09, 2012 9:42 am

The code should work. I've just tested the one I modified for ozstar on my live store (1.5.1.3) and it worked fine. I can't see why it wouldn't work on 1.5.4.1 (or other versions too).

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by ozstar » Sun Sep 09, 2012 10:29 am

HI,

Yes it seems to work fine. I had to change the weights in system to grams and gave each CD 105 gs.

Also had a $1 handling charge for bag cost. Checkout estimate gave correct figures of $2.20 and for 2 CDs $2.80.

Many many thanks.

Such a basic thing but I have been stuck on this for ages and no mod free or paid has it.

I think it should be added to the standard AustPost extn.
I am sure that others would really welcome it.

I would like to change the name to Australia Post Standard Letter Rate.

Where would i do this please?

A great job philbydevil :-)

oz

Active Member

Posts

Joined
Fri Mar 09, 2012 7:47 am
Location - Sydney OZ

Post by philbydevil » Sun Sep 09, 2012 11:01 am

Good to hear it's working for you ;D

To change the names of any satchels, etc go here:

Code: Select all

catalog/language/english/shipping/auspost.php

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by bronts » Sun Sep 09, 2012 11:04 am

I'm back now and will test it now.

User avatar
Active Member

Posts

Joined
Sat Jul 14, 2012 12:56 pm
Location - QLD Australia

Post by bronts » Sun Sep 09, 2012 11:09 am

Getting this error now :(

Code: Select all

Warning: Division by zero in /home/content/G/e/n/GeneralChoi/html/SITES/RedraglynsGems/shop/system/library/weight.php on line 38Notice: Undefined index: length_class in /home/content/G/e/n/GeneralChoi/html/SITES/RedraglynsGems/shop/catalog/model/shipping/auspost.php on line 77
Please select the preferred shipping method to use on this order.
The basket weight is 0g, unable to calculate shipping costs

User avatar
Active Member

Posts

Joined
Sat Jul 14, 2012 12:56 pm
Location - QLD Australia

Post by philbydevil » Sun Sep 09, 2012 11:16 am

I don't know why you're getting those errors. Sorry.

Check in admin what the Length Class and Weight Class are set to (System->Settings->Local). Mine is set to CM and KG, so that means I put weights like 0.1 for 100g and 0.3 for 3mm. Maybe it's set wrong and all of your weights/lengths look like zero?

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by bronts » Sun Sep 09, 2012 11:20 am

I have tried to attach a screenshot of the item in the products.

Attachments

eg.jpg

example of the item I tried to purchase - eg.jpg (26.15 KiB) Viewed 5493 times


User avatar
Active Member

Posts

Joined
Sat Jul 14, 2012 12:56 pm
Location - QLD Australia

Post by bronts » Sun Sep 09, 2012 11:27 am

You're welcome to go into my admin and have a look if you like?

User avatar
Active Member

Posts

Joined
Sat Jul 14, 2012 12:56 pm
Location - QLD Australia

Post by philbydevil » Sun Sep 09, 2012 11:34 am

Ok, so that picture is showing that the item weight 0.02 grams. The info I said before about setting it to 0.02 was because I have my settings in KG. Sorry. You should set that to 20, not 0.02. That should sort out the weight problem.

Then, if you are going to set dimensions, then it will be in full numbers like 33 (if you put in 0.033 or something like that it will probably be rounding down to zero). You're set to MM and my instructions were relating to CM. Sorry again.

Try that and see how you go.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Sun Sep 09, 2012 11:39 am

Also, just to rule out any conflicts, go to:

System->Settings->Local

And make sure it is set to Millimeter and Gram too (or the same as the settings in the individual product).

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by bronts » Sun Sep 09, 2012 11:45 am

that setting is fine, but I am still getting the error, so maybe it's in that other classes setting :/

User avatar
Active Member

Posts

Joined
Sat Jul 14, 2012 12:56 pm
Location - QLD Australia
Who is online

Users browsing this forum: No registered users and 125 guests