Hutchmeister Posted October 20, 2006 Share Posted October 20, 2006 Hi, I'm really new to OSC so have only been reading this forum for about 3 days so I apologise if this 'solution' has been submitted before [based on UK shop setup, but will apply to any zone/country setup] Problem: When using the Zone Rates module one caveat is that if the upper weight limit for each zone is passed, the shipping method will be offered with ?0.00. The install/help file suggests that to stop people getting free postage one should add a really high weight limit/price entry to the zones shipping table e.g. "999:1000". This is ugly as its very possible that users will see a postage cost of ?1000 one day. My solution: This is a blatant hack, and a bit embarrassing really as it shows my lack of PHP finesse. I figured that instead of showing customers a ?0.00 or ?1000 shipping cost it's way better to show them a message that says something like "A suitable Standard Shipping option could not be found. Please call customer services" and NOT show them a radio button to click. To achieve this I ADDED the following to the 'catalog\includes\languages\english\modules\shipping\zones.php' file (I put it just after the line that defines the 'MODULE_SHIPPING_ZONES_UNDEFINED_RATE'): define('MODULE_SHIPPING_ZONES_ZERO_COST', 'A suitable shipping option could not be found. Please call customer services.'); Then in the 'catalog\includes\modules\shipping\zones.php' file I added the line: if ($shipping_cost == 0) {$this->quotes['error'] = MODULE_SHIPPING_ZONES_ZERO_COST;} to this block of code (see line 160 for the new code. Note that your line numbers may differ a bit): 155 $this->quotes = array('id' => $this->code, 156 'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE, 157 'methods' => array(array('id' => $this->code, 158 'title' => $shipping_method, 159 'cost' => $shipping_cost))); 160 if ($shipping_cost == 0) {$this->quotes['error'] = MODULE_SHIPPING_ZONES_ZERO_COST;} 161 if ($this->tax_class > 0) { 162 $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); 163 } And that's it. So far its working well here. I use this hack along with this contribution: Additional Shipping Options for Zone Module and therefore apply the hack to all relevant zone modules, but you can use it with the existing 'included' zone rates module that comes with OSC 2.2 If anyone has a better way please post it. If not I hope this helps someone! :D Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted October 20, 2006 Share Posted October 20, 2006 (edited) Ya that has already been done. You pretty much did the same code. Good intuition :thumbsup: Here is the zone contrib: zonesx-multiple packages Link: http://www.oscommerce.com/community/contri...,zones+multiple Edited October 20, 2006 by insomniac2 Quote Link to comment Share on other sites More sharing options...
Hutchmeister Posted October 20, 2006 Author Share Posted October 20, 2006 Ok thanks i'll check that out Quote Link to comment Share on other sites More sharing options...
sportykev Posted November 3, 2006 Share Posted November 3, 2006 I've tried your code out, I was wondering if its possible to keep it doing what it does (display the msg) but allow to checkout? 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.