Jump to content
Sign in to follow this  
Guest

error when shipping and weight is 0.000x kg

Recommended Posts

Guest

Okay here a good one!

 

I sell cut opal stones in my store and the weight I use to weigh them is grams.

I use the Auspost contribution to calculate shipping, to use this addon

 

1. everything has to be done in kgs

2. max shipping weight has to be set at "20" (kg) in admin - configuration - shipping/packaging

3. Tare weight must be set at 0

4. Large package must be 0

 

So in order to use it I MUST use correct weights. Most of my stones weigh around 0.2 grams which equates to 0.0002 kg

Now if you add a stone to the cart which weighs 0.0002kg the Auspost shipping calculater gives an error.

 

The only way I can get Auspost to calculate is to use a weight with less than 2 decimal places before a non zero number (i.e. 0.002 kg) This is okay because my packaging weighs 10 grams, so the customer doesnt get ripped off with shipping costs.

I would just like to know if anyone has any ideas why it does this?

I use Creloaded 6.1a

 

Shane

Share this post


Link to post
Share on other sites

I am also facing the same situation.

 

My craft stamps weigh around 10 to 100 grams.

 

One way around it is to charge a flat rate, but that's no good is you have a customer who wants insurance.

 

The only thing I can think of is to email someone how writes the auspost contribution and see if they are willing to fix the problem.

 

Other thoughts??>

Share this post


Link to post
Share on other sites
Guest
I am also facing the same situation.

 

My craft stamps weigh around 10 to 100 grams.

 

One way around it is to charge a flat rate, but that's no good is you have a customer who wants insurance.

 

The only thing I can think of is to email someone how writes the auspost contribution and see if they are willing to fix the problem.

 

Other thoughts??>

 

Tried that but got no response

Shane

Edited by Shanet

Share this post


Link to post
Share on other sites

Talked to someone who knows the bloke who wrote the module. Nothing is going to be touched until after the new version of oscommerce is released. And when the release date is, they haven't decided yet.

 

Are there any other modules for other countries that do allow an extra zero? If so, can they be modified?

 

I guess the answer is no.... d.i.y.

Share this post


Link to post
Share on other sites

If a minimum weight is a problem, can't you code for that?

 

For example in auspostair.php in the function quote the weight that is posted to http://drc.edeliver.com.au/ratecalc.asp is:

$sweight = $shipping_weight*1000;

Say the minimum weight is 1 gram I think something like this could work:

$sweight = ($shipping_weight < 0.001)?1:$shipping_weight*1000;

meaning: $sweight = (expression)?returned_if_expression=true:returned_if_expression_is_false;

Share this post


Link to post
Share on other sites
Guest
If a minimum weight is a problem, can't you code for that?

 

For example in auspostair.php in the function quote the weight that is posted to http://drc.edeliver.com.au/ratecalc.asp is:

$sweight = $shipping_weight*1000;

Say the minimum weight is 1 gram I think something like this could work:

$sweight = ($shipping_weight < 0.001)?1:$shipping_weight*1000;

meaning: $sweight = (expression)?returned_if_expression=true:returned_if_expression_is_false;

 

I tried mucking around with that line of code (but not like you have) and all I got was a wrong shipping price. As I understand it the (*1000) part is telling Auspost that the weight is in kg. Ill have a go with your code on my test site and see what happens

 

Shane

Share this post


Link to post
Share on other sites
As I understand it the (*1000) part is telling Auspost that the weight is in kg
Actually, I think it is taking the value you have in kg and converting that in gram for Auspost. Perhaps Auspost doesn't like any decimals in the grams and you need to add as a second line:

$sweight = round($sweight, 0); // round to the nearest integer value

Good luck anyway.

Share this post


Link to post
Share on other sites
Guest
Actually, I think it is taking the value you have in kg and converting that in gram for Auspost. Perhaps Auspost doesn't like any decimals in the grams and you need to add as a second line:

$sweight = round($sweight, 0); // round to the nearest integer value

Good luck anyway.

 

Hey that sounds good to me! What I know about php you could write on a postage stamp! Its all a learnig curve for me please keep the suggestions coming.

I'll try using both lines and see what happens. (when I get the time, I work a 14hr day at a mine site)

 

Shane

Share this post


Link to post
Share on other sites
Guest

JanZ

 

Let me shower you in kisses! I added both lines and it works perfectly!

 

Thanks a lot for all your help

 

Shane

Share this post


Link to post
Share on other sites

its not working for me.

I change the following and it works fine

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

to

$shipping_auspost_cost = ($charge/1.1);

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  

×