Post by calvinko » Thu Oct 11, 2007 7:00 am

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.

Newbie

Posts

Joined
Thu Oct 11, 2007 6:50 am

Post by xyz359 » Sat Oct 13, 2007 8:02 am

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. =)

Newbie

Posts

Joined
Sat Oct 13, 2007 8:01 am

Post by Daniel » Sun Oct 14, 2007 6:50 pm

Have you tried the zone based shipping?

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

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by xyz359 » Mon Oct 15, 2007 6:07 am

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.

???

Newbie

Posts

Joined
Sat Oct 13, 2007 8:01 am

Post by xyz359 » Wed Oct 17, 2007 9:10 am

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. =(

Newbie

Posts

Joined
Sat Oct 13, 2007 8:01 am

Post by salmoon » Thu Nov 01, 2007 7:22 pm

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

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by gary » Tue Nov 06, 2007 9:30 am

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
Last edited by gary on Fri Nov 16, 2007 1:09 am, edited 1 time in total.

New member

Posts

Joined
Sun Nov 04, 2007 11:55 pm

Post by salmoon » Wed Nov 14, 2007 7:03 pm

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.

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by salmoon » Wed Nov 14, 2007 7:05 pm

Sorry just re-read your post, it works the same as how i described. lol.

New member

Posts

Joined
Sun Oct 21, 2007 9:59 pm

Post by gary » Thu Nov 15, 2007 1:03 am

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.
Last edited by gary on Fri Nov 16, 2007 1:10 am, edited 1 time in total.

New member

Posts

Joined
Sun Nov 04, 2007 11:55 pm

Post by JohnnyO » Thu Nov 15, 2007 11:27 am

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
Last edited by JohnnyO on Thu Nov 15, 2007 11:29 am, edited 1 time in total.

If you make it idiot proof, they will just build a better idiot.


User avatar
New member

Posts

Joined
Wed Nov 14, 2007 7:31 am
Location - Denver, CO - USA

Post by gary » Fri Nov 16, 2007 12:34 am

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.
Last edited by gary on Fri Nov 16, 2007 12:38 am, edited 1 time in total.

New member

Posts

Joined
Sun Nov 04, 2007 11:55 pm

Post by drewxhawaii » Thu Mar 20, 2008 6:31 pm

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(),

http://www.yourwebmasters.com


Newbie

Posts

Joined
Thu Mar 20, 2008 5:54 pm
Location - Honolulu, HI

Post by johny2k » Mon Mar 31, 2008 4:30 pm

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

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm
Who is online

Users browsing this forum: No registered users and 4 guests