Page 1 of 1

Weight base shipping by pablohoney

Posted: Thu Oct 11, 2007 7:00 am
by calvinko
Anyone used this module but have problem after the total is calculated? When I get to the last part of calculation, it will calculate the per pound price instead of the pound x (times) $ per pound.

Re: Weight base shipping by pablohoney

Posted: Sat Oct 13, 2007 8:02 am
by xyz359
Yeah, I'm also having the same issue. Unfortunately, I'm not too great at PHP. Hopefully somebody else can help us figure this out. =)

Re: Weight base shipping by pablohoney

Posted: Sun Oct 14, 2007 6:50 pm
by Daniel
Have you tried the zone based shipping?

it calcualtes weight:cost,weight:cost etc..

Re: Weight base shipping by pablohoney

Posted: Mon Oct 15, 2007 6:07 am
by xyz359
I have, and it doesn't seem to be the same as the weight-based system. When I tried using Zone based shipping, I would specify that one pound would cost $2. If I added an item that weighed, lets say, 0.5 lbs, it would still charge $2 when I only needed $1.

???

Re: Weight base shipping by pablohoney

Posted: Wed Oct 17, 2007 9:10 am
by xyz359
Please, if anybody could give us a little guidance that'd be *greatly* appreciated. I figure it's a problem in the checkout_confirm controller.

Please please help. =(

Re: Weight base shipping by pablohoney

Posted: Thu Nov 01, 2007 7:22 pm
by salmoon
Has anyone found a solution?

The weightbased thing doesn't seem to work at all for me. I set the weight-based cost per unit thing to £1 per 100 grams  (1.00:100?), I have items set at a weight of 500 grams.. yet the shipping comes to £1.00... when it should come to £5.00.

Surely i must be doing something wrong.. i can't imagine a module to be released if it doesn't actually work..

Please help..

Thanks

Re: Weight base shipping by pablohoney

Posted: Tue Nov 06, 2007 9:30 am
by gary
Daniel wrote: Have you tried the zone based shipping?

it calcualtes weight:cost,weight:cost etc..
---------------------
EDIT: - I checked the code (a few posts below) - and it does use <=
Sorry for any confusion

Zone based shipping works pretty well.
The logic is simple. For example:

2:5,5:10

This means - that if product weight units in the cart add up to 2 or less - the shipping price will be 5 currency units
If product weight units in the cart add up to 5 or less - the shipping price will be 10 currency units

The only problem is - if total weight units in the cart will add up to more than 5 - the shipping price will be 0.

More about that a few posts below.

Sorry for any confusion again - this is about zone based shipping.
-----------------------

In my case I wanted a flat price for each zone, no matter how much weight products will add-up to. So I specified 0 as product weight and specified price for zone as:
0:15


Now just some ideas - NOTE - system does NOT work like that at the moment:

For those that want shipping price to be per weight unit (for example per pound or per 50 grams..) - the expression should probably be something like:
1x10 
meaning weight units multiplied by currency units. Just an idea...

Most often though - shiping costs are based by weight limits. Like post office charges $5 for everything up to pound.
Of course - there maybe a need for combination of both. Say - $5 for everything up to a pound and then $1 for every pound on top of that. We could express it like 1:5+1x1

Re: Weight base shipping by pablohoney

Posted: Wed Nov 14, 2007 7:03 pm
by salmoon
Gary,

For me zone shipping works different to how you described. If i set  1.00:200,2.00:300 etc then the cost of shipping is 1.00 if weight is between 0 and 200 grams, or 2.00 if weight is between 201 and 300 grams.

Re: Weight base shipping by pablohoney

Posted: Wed Nov 14, 2007 7:05 pm
by salmoon
Sorry just re-read your post, it works the same as how i described. lol.

Re: Weight base shipping by pablohoney

Posted: Thu Nov 15, 2007 1:03 am
by gary
salmoon wrote: Gary,
For me zone shipping works different to how you described. If i set  1.00:200,2.00:300 etc then the cost of shipping is 1.00 if weight is between 0 and 200 grams, or 2.00 if weight is between 201 and 300 grams.
well, I cannot try it now - but when I was testing with weight cost - it only worked if weight matched exactly. I will have to try it again.

Also - I thought you have to specify it like weight:cost, not cost:weight

EDIT: sorry - I was talking about zone based shipping. Also - I re-tested - it works as I described a few posts up.

Re: Weight base shipping by pablohoney

Posted: Thu Nov 15, 2007 11:27 am
by JohnnyO
I believe the error is coming from here in the catalog/extension/shipping/weight.php

      $quote_data['weight'] = array(
        'id'    => 'weight_weight',
        'title' => $this->language->get('text_weight_description'),

        'cost'  => $this->config->get('weight_cost') * $this->cart->countProducts(),
        'text'  => $this->currency->format($this->tax->calculate($this->config->get('weight_cost') * $this->cart->getWeight(), $this->config->get('weight_tax_class_id'), $this->config->get('config_tax')))
      );
My php skills are not quite where they need to be .. Maybe somebody with more know how could take a look at this.

-JO

Re: Weight base shipping by pablohoney

Posted: Fri Nov 16, 2007 12:34 am
by gary
it is in catalog/extension/shipping/zone.php

$cost = 0;

$rates = explode(',', $this->config->get('zone_' . $result['geo_zone_id'] . '_cost'));

foreach ($rates as $rate) {
  $array = explode(':', $rate);
 
if ($this->cart->getWeight() config->get('zone_' . $result['geo_zone_id'] . '_cost'));

$highestrate = 0;
foreach ($rates as $rate) {
  $array = explode(':', $rate);
 
if ($highestrate cart->getWeight() <= $array[0]) {
    $cost = @$array[1];

  break;
  }
}

if ($cost == 0) {
$cost = $highestrate;
}

EDIT: sorry - this is zone based shipping, not weight based. I did not try weight based mod.

Re: Weight base shipping by pablohoney

Posted: Thu Mar 20, 2008 6:31 pm
by drewxhawaii
i fixed this problem on my site. here's my code.


/catalog/extension/shipping/weight.php

Code: Select all

//'cost'  => $this->config->get('weight_cost') * $this->cart->countProducts(),
'cost'  => $this->config->get('weight_cost') * $this->cart->getWeight(),

Re: Weight base shipping by pablohoney

Posted: Mon Mar 31, 2008 4:30 pm
by johny2k
drewxhawaii wrote: i fixed this problem on my site. here's my code.


/catalog/extension/shipping/weight.php

Code: Select all

//'cost'  => $this->config->get('weight_cost') * $this->cart->countProducts(),
'cost'  => $this->config->get('weight_cost') * $this->cart->getWeight(),
Thx u so much!!!!  :D :D