Seagoofy Posted January 18, 2007 Share Posted January 18, 2007 Hi been modifying the "Padoren"-contribution (Norwegian postal contrib), but the problem would be the same in any shipping module I've seen so far. Namely: I use "volume-weight" for shipping, but I need to add some extra handling cost to the shipment based on the actual (product)weight of the heaviest item in cart. (some people charge extra if they have to carry a 100+ kg stove to the n:th floor :P ) Basically I need to get an array of the products_weight(s) in cart and figure out the heaviest weight. (I figure easiest way to get the heaviest would be to sort the array by weight and pick the first or last depending on sort order) The problem is I don't seem to be able to create the array :blush: Among other things I've tried: adding $cart to the (shipping module) globals and added this piece of code to the shipping module: $kollit_array = 0; $kollit = $cart->get_products(); for ($i=0, $n=sizeof($kollit); $i<$n; $i++) { $this->kollit[$kollit_array] = array('weight' => $kollit[$i]['weight']); echo $kollit_array; the echo is for testing purposes, it gives me "00" (double zero). If I place it before the "for" I get "array". So apparently I get an empty array :angry: I'm sure my mistakes are elementary, but I seem to have hit the wall. Any ideas? thanks Seagoofy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.