fubu Posted August 9, 2003 Share Posted August 9, 2003 I'm poor with PHP and have been trying to modify free shipping to purchases above 50 dollars but at the same time I only want to give free shipping to orders under 10kg. I think this is the file that needs to be modified (htdocscatalogincludesmodulesorder_totalot_shipping.php) around line 44: if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { $order->info['shipping_method'] = $this->title; $order->info['total'] -= $order->info['shipping_cost']; $order->info['shipping_cost'] = 0; I've added a condition to the if statement to the following: if ( ($pass == true) && ($total_weight<'10') && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { $order->info['shipping_method'] = $this->title; $order->info['total'] -= $order->info['shipping_cost']; $order->info['shipping_cost'] = 0; and I've declared $total_weight = $cart->show_weight(); above it. I think it's just a matter of checking the weight of the cart in this bit, but my php is pretty poor, so please help!!!! Quote Link to comment Share on other sites More sharing options...
Rumble Posted August 9, 2003 Share Posted August 9, 2003 in ot_shipping.php find the following function process() { global $order, $currencies; and change to function process() { global $order, $currencies, $shipping_weight; then in your code change from $total_weight = $cart->show_weight(); to..... $total_weight = $shipping_weight; Back up before you try Quote Reddy to Rumble Thank you osCommerce and all who Contribute to her! Link to comment Share on other sites More sharing options...
fubu Posted August 10, 2003 Author Share Posted August 10, 2003 Hi, I've just tried your suggestions above. I'm not getting any errors, so I'm probably getting closer. However it's still giving out free shipping for orders over 10kg. Any further suggestions? :cry: Quote Link to comment Share on other sites More sharing options...
Arien Posted August 20, 2003 Share Posted August 20, 2003 any news on this contribution? I'd really like to have one like this on my site. Quote Link to comment Share on other sites More sharing options...
Arien Posted August 20, 2003 Share Posted August 20, 2003 well i just had a little go at it.. no luck, if anyone could help? 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.