PaulG Posted December 6, 2003 Share Posted December 6, 2003 Is there a module what uses the table method way with weights, but has an price cap in it. I'm building an osCommerce 2.2 shop. I need an shipping method (shipping price) on weight. When the price is above a vallue there aren't any shipping costs Is there a simple way, or amn module what this does?? Thanks for all the help. Link to comment Share on other sites More sharing options...
sjd256 Posted December 6, 2003 Share Posted December 6, 2003 Paul, This is exactly what I was after but I couldn't find a contrib either for it. I wrote a little modification with the help of Kagg that may be useful to you - it works well for me. As always back up your file first and use at your own risk ;-) You may try modifying any one of your shipping files in /catalog/includes/modules/shipping/....php . Add the following lines in function quote(): //Modification for maximum weight $order_total = $shipping_weight; //change the number two to the maximum weight if ($order_total >= 2) { $error = 'over'; } else { $this->quotes = array('id' => $this->code, //change the module name below to reflect the shipping module 'module' => MODULE_SHIPPING_UKRD_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost'=> $shipping_cost))); } //end of maximum weight Then at the end of the function quote I have added the following line just before the return $this->quotes;: if ($error =='over') $this->quotes['error'] = 'To heavy for this service'; Hope that the above is helpful - you just need to change the details that I have highlighted above. Cheers Steve Link to comment Share on other sites More sharing options...
PaulG Posted December 7, 2003 Author Share Posted December 7, 2003 Thanks for your reply. With you reply I've thought of an simple but effective sollution. ? // set shipping cost to 0 when total value is above '350' if ($cart->show_total() > 350) { ? ? ? $shipping = 0; ? ? ? } ? $this->quotes = array('id' => $this->code, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'methods' => array(array('id' => $this->code, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'title' => MODULE_SHIPPING_TABLE_TEXT_WAY, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING))); I add the 'if show_total is heigher then value' statement, and this does what I want. thanks again Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.