Results 1 to 10 of 23

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Posts
    90
    Plugin Contributions
    0

    Default Re: Cloned shipping module problem

    <?php
    //
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2003 The zen-cart developers |
    // | |
    // | http://www.zen-cart.com/index.php |
    // | |
    // | Portions Copyright (c) 2003 osCommerce |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license, |
    // | that is bundled with this package in the file LICENSE, and is |
    // | available through the world-wide-web at the following url: |
    // | http://www.zen-cart.com/license/2_0.txt. |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to |
    // | license AT zen-cart DOT com so we can mail you a copy immediately. |
    // +----------------------------------------------------------------------+
    // $Id: cod.php 1969 2005-09-13 06:57:21Z drbyte $
    //
    define('MODULE_SHIPPING_COD_TEXT_TITLE', 'cod');
    define('MODULE_SHIPPING_COD_TEXT_DESCRIPTION', 'Customer In Store Pick-up');
    define('MODULE_SHIPPING_COD_TEXT_WAY', 'Must be selected for COD orders');
    ?>

  2. #2
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Cloned shipping module problem

    Quote Originally Posted by psr racing View Post
    <?php
    //
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2003 The zen-cart developers |
    // | |
    // | http://www.zen-cart.com/index.php |
    // | |
    // | Portions Copyright (c) 2003 osCommerce |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license, |
    // | that is bundled with this package in the file LICENSE, and is |
    // | available through the world-wide-web at the following url: |
    // | http://www.zen-cart.com/license/2_0.txt. |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to |
    // | license AT zen-cart DOT com so we can mail you a copy immediately. |
    // +----------------------------------------------------------------------+
    // $Id: cod.php 1969 2005-09-13 06:57:21Z drbyte $
    //
    define('MODULE_SHIPPING_COD_TEXT_TITLE', 'cod');
    define('MODULE_SHIPPING_COD_TEXT_DESCRIPTION', 'Customer In Store Pick-up');
    define('MODULE_SHIPPING_COD_TEXT_WAY', 'Must be selected for COD orders');
    ?>
    Just confirming that this file is called public_HTML/includes/languages/english/modules/shipping/cod.php?

    Also, need to see your module file too.... public_HTML/includes/modules/shipping/cod.php

  3. #3
    Join Date
    Feb 2007
    Posts
    90
    Plugin Contributions
    0

    Default Re: Cloned shipping module problem

    Yes that was the public_HTML/includes/languages/english/modules/shipping/cod.php

    This is the other one

    <?php
    /**
    * @package shippingMethod
    * @copyright Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: cod.php 4821 2006-10-23 10:54:15Z drbyte $
    */
    /**
    * cod / Will-Call shipping method
    *
    */
    class storepickup extends base {
    /**
    * $code determines the internal 'code' name used to designate "this" payment module
    *
    * @var string
    */
    var $code;
    /**
    * $title is the displayed name for this payment method
    *
    * @var string
    */
    var $title;
    /**
    * $description is a soft name for this payment method
    *
    * @var string
    */
    var $description;
    /**
    * module's icon
    *
    * @var string
    */
    var $icon;
    /**
    * $enabled determines whether this module shows or not... during checkout.
    *
    * @var boolean
    */
    var $enabled;
    /**
    * constructor
    *
    * @return cod
    */
    function cod() {
    global $order, $db;
    $this->code = 'cod';
    $this->title = MODULE_SHIPPING_COD_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_COD_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_COD_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_COD_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_COD_TAX_BASIS;
    $this->enabled = ((MODULE_SHIPPING_COD_STATUS == 'True') ? true : false);
    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_COD_ZONE > 0) ) {
    $check_flag = false;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . "
    where geo_zone_id = '" . MODULE_SHIPPING_COD_ZONE . "'
    and zone_country_id = '" . $order->delivery['country']['id'] . "'
    order by zone_id");
    while (!$check->EOF) {
    if ($check->fields['zone_id'] < 1) {
    $check_flag = true;
    break;
    } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
    $check_flag = true;
    break;
    }
    $check->MoveNext();
    }
    if ($check_flag == false) {
    $this->enabled = false;
    }
    }
    }
    /**
    * Obtain quote from shipping system/calculations
    *
    * @param string $method
    * @return array
    */
    function quote($method = '') {
    global $order;
    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_COD_TEXT_TITLE,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_COD_TEXT_WAY,
    'cost' => MODULE_SHIPPING_COD_COST)));
    if ($this->tax_class > 0) {
    $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    }
    if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
    return $this->quotes;
    }
    /**
    * Check to see whether module is installed
    *
    * @return boolean
    */
    function check() {
    global $db;
    if (!isset($this->_check)) {
    $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_COD_STATUS'");
    $this->_check = $check_query->RecordCount();
    }
    return $this->_check;
    }
    /**
    * Install the shipping module and its configuration settings
    *
    */
    function install() {
    global $db;
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Store Pickup Shipping', 'MODULE_SHIPPING_COD_STATUS', 'True', 'Do you want to offer In Store rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_COD_COST', '0.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())");
    $db->Execute("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_COD_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_COD_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\'), ', now())");
    $db->Execute("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_COD_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_COD_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    }
    /**
    * Remove the module and all its settings
    *
    */
    function remove() {
    global $db;
    $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }
    /**
    * Internal list of configuration keys used for configuration of the module
    *
    * @return array
    */
    function keys() {
    return array('MODULE_SHIPPING_COD_STATUS', 'MODULE_SHIPPING_COD_COST', 'MODULE_SHIPPING_COD_TAX_CLASS', 'MODULE_SHIPPING_COD_TAX_BASIS', 'MODULE_SHIPPING_COD_ZONE', 'MODULE_SHIPPING_COD_SORT_ORDER');
    }
    }
    ?>

  4. #4
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default Re: Cloned shipping module problem

    Quote Originally Posted by psr racing View Post
    Yes that was the public_HTML/includes/languages/english/modules/shipping/cod.php

    This is the other one

    <?php
    /**
    * @package shippingMethod
    * @copyright Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: cod.php 4821 2006-10-23 10:54:15Z drbyte $
    */
    /**
    * cod / Will-Call shipping method
    *
    */
    class storepickup extends base {
    /**
    * $code determines the internal 'code' name used to designate "this" payment module
    *
    * @var string
    */
    var $code;
    /**
    * $title is the displayed name for this payment method
    *
    * @var string
    */
    var $title;
    /**
    * $description is a soft name for this payment method
    *
    * @var string
    */
    var $description;
    /**
    * module's icon
    *
    * @var string
    */
    var $icon;
    /**
    * $enabled determines whether this module shows or not... during checkout.
    *
    * @var boolean
    */
    var $enabled;
    /**
    * constructor
    *
    * @return cod
    */
    function cod() {
    global $order, $db;
    $this->code = 'cod';
    $this->title = MODULE_SHIPPING_COD_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_COD_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_COD_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_COD_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_COD_TAX_BASIS;
    $this->enabled = ((MODULE_SHIPPING_COD_STATUS == 'True') ? true : false);
    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_COD_ZONE > 0) ) {
    $check_flag = false;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . "
    where geo_zone_id = '" . MODULE_SHIPPING_COD_ZONE . "'
    and zone_country_id = '" . $order->delivery['country']['id'] . "'
    order by zone_id");
    while (!$check->EOF) {
    if ($check->fields['zone_id'] < 1) {
    $check_flag = true;
    break;
    } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
    $check_flag = true;
    break;
    }
    $check->MoveNext();
    }
    if ($check_flag == false) {
    $this->enabled = false;
    }
    }
    }
    /**
    * Obtain quote from shipping system/calculations
    *
    * @param string $method
    * @return array
    */
    function quote($method = '') {
    global $order;
    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_COD_TEXT_TITLE,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_COD_TEXT_WAY,
    'cost' => MODULE_SHIPPING_COD_COST)));
    if ($this->tax_class > 0) {
    $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    }
    if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
    return $this->quotes;
    }
    /**
    * Check to see whether module is installed
    *
    * @return boolean
    */
    function check() {
    global $db;
    if (!isset($this->_check)) {
    $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_COD_STATUS'");
    $this->_check = $check_query->RecordCount();
    }
    return $this->_check;
    }
    /**
    * Install the shipping module and its configuration settings
    *
    */
    function install() {
    global $db;
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Store Pickup Shipping', 'MODULE_SHIPPING_COD_STATUS', 'True', 'Do you want to offer In Store rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_COD_COST', '0.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())");
    $db->Execute("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_COD_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_COD_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\'), ', now())");
    $db->Execute("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_COD_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_COD_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    }
    /**
    * Remove the module and all its settings
    *
    */
    function remove() {
    global $db;
    $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }
    /**
    * Internal list of configuration keys used for configuration of the module
    *
    * @return array
    */
    function keys() {
    return array('MODULE_SHIPPING_COD_STATUS', 'MODULE_SHIPPING_COD_COST', 'MODULE_SHIPPING_COD_TAX_CLASS', 'MODULE_SHIPPING_COD_TAX_BASIS', 'MODULE_SHIPPING_COD_ZONE', 'MODULE_SHIPPING_COD_SORT_ORDER');
    }
    }
    ?>

    Just as I suspected!

    class storepickup extends base {

    change to:

    class cod extends base {

    should work then....

    looks like you did a find and replace and missed that one


    Shrimp-Gumbo

  5. #5
    Join Date
    Feb 2007
    Posts
    90
    Plugin Contributions
    0

    Default Re: Cloned shipping module problem

    Your a legend how could I miss it right at the top there

  6. #6
    Join Date
    Feb 2007
    Posts
    90
    Plugin Contributions
    0

    Default Re: Cloned shipping module problem

    What do I have to change to make my most expensive shipping option the default choice? (Per Unit)

  7. #7
    Join Date
    May 2005
    Location
    Bath, Somerset
    Posts
    1,053
    Plugin Contributions
    3

    Default Re: Cloned shipping module problem

    The default shipping method is calculated using a cheapest shipping class function. If you use the developers tool in the admin, oyu can see which file this function exists within. You would need to go through and either replace this with a new function, or butcher the cheapest function to return the most expensive method.

    Personally, I would go with creating a new class function, so that it is obvious when you return the code in a year or so what is happening.

    Absolute

 

 

Similar Threads

  1. v154 Help with cloned shipping module
    By gwynwyffar in forum Addon Shipping Modules
    Replies: 2
    Last Post: 17 Feb 2016, 03:36 PM
  2. Help...weird problem with cloned UPS shipping module
    By nomoremoo in forum Addon Shipping Modules
    Replies: 0
    Last Post: 7 Sep 2010, 01:12 AM
  3. Using a cloned shipping module
    By Verne in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 2 Aug 2009, 10:13 PM
  4. Cloned Shipping Module problem?
    By slannesh in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 19 Jun 2009, 04:18 PM
  5. Cloned Shipping Module not working
    By Sake in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 24 Sep 2007, 04:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg