Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

error when shipping and weight is 0.000x kg


Guest

Recommended Posts

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

Link to comment
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??>

Link to comment
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??>

 

Tried that but got no response

Shane

Edited by Shanet
Link to comment
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.

Link to comment
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;

Link to comment
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;

 

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

Link to comment
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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...