webduck123 Posted June 4, 2005 Share Posted June 4, 2005 One of my osCommerce customers recently asked me about offering express shipping in addition to the free shipping shipping option they are already offering. The Modules>Order Total>Shipping functionality does not offer this. Is there a way to offer free shipping over a certain dollar amount, but then offer express shipping? Has anyone dealt with this issue before? Any assistance or ideas greatly appreciated. Thank you in advance for taking the time to respond to my post. Search phrases: free shipping, free shipping plus express shipping, express shipping options, shipping options Quote Link to comment Share on other sites More sharing options...
♥kymation Posted June 4, 2005 Share Posted June 4, 2005 I had a similar situation a while back, so I wrote a Free shipping module. If you enable this module plus whatever other shipping options you want to offer, the default will be for free shipping but the other options can be selected. I never used the code (customer changed his mind), but it should work. Here's the module code file: <?php /* $Id: free.php,v 1.0 2004/12/05 jck Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2004 osCommerce Released under the GNU General Public License */ class free { var $code, $title, $description, $icon, $enabled; // class constructor function free() { global $order; $this->code = 'free'; $this->title = MODULE_SHIPPING_FREE_TEXT_TITLE; $this->description = MODULE_SHIPPING_FREE_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_FREE_SORT_ORDER; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_FREE_TAX_CLASS; $this->enabled = ((MODULE_SHIPPING_FREE_STATUS == 'True') ? true : false); if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FREE_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FREE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } } // class methods function quote($method = '') { global $order; $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREE_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FREE_TEXT_WAY, 'cost' => 0))); if ($this->tax_class > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); return $this->quotes; } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FREE_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Free Shipping', 'MODULE_SHIPPING_FREE_STATUS', 'True', 'Do you want to offer free shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_FREE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '1', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_FREE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_FREE_SORT_ORDER', '0', 'Sort order of display.', '6', '3', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_SHIPPING_FREE_STATUS', 'MODULE_SHIPPING_FREE_TAX_CLASS', 'MODULE_SHIPPING_FREE_ZONE', 'MODULE_SHIPPING_FREE_SORT_ORDER'); } } ?> and here's the language file to go with it. <?php /* $Id: free.php,v 1.0 2004/12/05 jck Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2004 osCommerce Released under the GNU General Public License */ define('MODULE_SHIPPING_FREE_TEXT_WAY', 'Ground shipping (3 to 10 days).'); define('MODULE_SHIPPING_FREE_TEXT_TITLE', 'Free Shipping'); ?> Please let me know if this works for you. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Rowcal Posted June 16, 2005 Share Posted June 16, 2005 hey Jim. Looks great. but Newbi question.. which file i should Config?? :lol: Thank you Quote Link to comment Share on other sites More sharing options...
♥kymation Posted June 16, 2005 Share Posted June 16, 2005 The above file, plus whatever you want to use for your priority shipping. If you want to provide FedEx for faster shipping, you would set up the fedex1 module and the free module. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
♥kymation Posted June 16, 2005 Share Posted June 16, 2005 The above file, plus whatever you want to use for your priority shipping. If you want to provide FedEx for faster shipping, you would set up the fedex1 module and the free module. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
Rowcal Posted June 17, 2005 Share Posted June 17, 2005 i mean what is the file name =) ? sorry i am a newbi >< Quote Link to comment Share on other sites More sharing options...
♥kymation Posted June 17, 2005 Share Posted June 17, 2005 For the ones that I posted? The first one is catalog/includes/modules/shipping/free.php, and the second is catalog/includes/languages/english/modules/shipping/free.php. Regards Jim Quote See my profile for a list of my addons and ways to get support. 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.