Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2008
    Location
    Texas
    Posts
    6
    Plugin Contributions
    0

    Default error with cloned shipping module

    I followed a tutorial here on the board to clone a shipping module. I did it with the flate rate shippin module. I created flate rate shipping for USA, APO, Canada, Mexico, and Elsewhere. However, when I tested ordering something under a Jane Doe account, I put in a US shipping address and the checkout told me it was not a place we ship to. How do I fix this?

  2. #2
    Join Date
    Sep 2008
    Location
    Texas
    Posts
    6
    Plugin Contributions
    0

    Default Re: error with cloned shipping module

    I forgot this information may be helpful:

    I created the following cloned files:
    flatapofpo.php
    flatcanada.php
    flatmexico.php
    flatusa.php
    flatother.php

    Here is what one of the clones looks like:
    <?php
    //
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2004 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 |
    // | [email protected] so we can mail you a copy immediately. |
    // +----------------------------------------------------------------------+
    // $Id: flatusa.php 1969 2005-09-13 06:57:21Z drbyte $
    //

    class flatusa {
    var $code, $title, $description, $icon, $enabled;

    // class constructor
    function flatusa() {
    global $order, $db;

    $this->code = 'flatusa';
    $this->title = MODULE_SHIPPING_FLATUSA_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_FLATUSA_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_FLATUSA_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_FLATUSA_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_FLATUSA_TAX_BASIS;

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
    $this->enabled = ((MODULE_SHIPPING_FLATUSA_STATUS == 'True') ? true : false);
    }

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLATUSA_ZONE > 0) ) {
    $check_flag = false;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLATUSA_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;
    }
    }
    }

    // class methods
    function quote($method = '') {
    global $order;

    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_FLATUSA_TEXT_TITLE,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_FLATUSA_TEXT_WAY,
    'cost' => MODULE_SHIPPING_FLATUSA_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;
    }

    function check() {
    global $db;
    if (!isset($this->_check)) {
    $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FLATUSA_STATUS'");
    $this->_check = $check_query->RecordCount();
    }
    return $this->_check;
    }

    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 Flat USA Shipping', 'MODULE_SHIPPING_FLATUSA_STATUS', 'True', 'Do you want to offer flat USA 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_FLATUSA_COST', '5.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_FLATUSA_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_FLATUSA_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\', \'Store\'), ', 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_FLATUSA_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_FLATUSA_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    }

    function remove() {
    global $db;
    $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
    return array('MODULE_SHIPPING_FLATUSA_STATUS', 'MODULE_SHIPPING_FLATUSA_COST', 'MODULE_SHIPPING_FLATUSA_TAX_CLASS', 'MODULE_SHIPPING_FLATUSA_TAX_BASIS', 'MODULE_SHIPPING_FLATUSA_ZONE', 'MODULE_SHIPPING_FLATUSA_SORT_ORDER');
    }
    }
    ?>

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: error with cloned shipping module

    And after you cloned the modules ... you then went and built each of the Zones to add to each of these modules, right?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Sep 2008
    Location
    Texas
    Posts
    6
    Plugin Contributions
    0

    Default Re: error with cloned shipping module

    Correct, I did create the following zones: USA, Canada, Mexico, APO/FPO, and Other.

    Now when I go to the admin shipping module page I am getting the following error messages:

    Warning: main(/home/animeadd/public_html/store/includes/languages/english/modules/shipping/flatapofpo.php) [function.main]: failed to open stream: No such file or directory in /home/animeadd/public_html/store/admin/modules.php on line 173

    Warning: main(/home/animeadd/public_html/store/includes/languages/english/modules/shipping/flatapofpo.php) [function.main]: failed to open stream: No such file or directory in /home/animeadd/public_html/store/admin/modules.php on line 173

    Warning: main() [function.include]: Failed opening '/home/animeadd/public_html/store/includes/languages/english/modules/shipping/flatapofpo.php' for inclusion (include_path='.:/usr/php4/lib/php:/usr/local/php4/lib/php') in /home/animeadd/public_html/store/admin/modules.php on line 173

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: error with cloned shipping module

    You made from:
    /includes/modules/shipping/flat.php
    /includes/languages/english/modules/shipping/flat.php

    /includes/modules/shipping/flatapofpo.php
    /includes/languages/english/modules/shipping/flatapofpo.php

    You did not leave any extra copies of backup files or extra files that might use these filenames in side?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Sep 2008
    Location
    Texas
    Posts
    6
    Plugin Contributions
    0

    Default Re: error with cloned shipping module

    Nope, I just did a search to be sure.

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: error with cloned shipping module

    Check these files:
    /store/includes/modules/shipping/flatapofpo.php
    /store/includes/languages/english/modules/shipping/flatapofpo.php

    Make sure the code is in the /modules and that the language defines are in the /languages ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Sep 2008
    Location
    Texas
    Posts
    6
    Plugin Contributions
    0

    Default Re: error with cloned shipping module

    Yeah, they are there.


    Here is what the shipping module in includes/languages/english/modules/shipping/flatusa.php looks like:

    <?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 |
    // | [email protected] so we can mail you a copy immediately. |
    // +----------------------------------------------------------------------+
    // $Id: flatusa.php 1969 2005-09-13 06:57:21Z drbyte $
    //

    define('MODULE_SHIPPING_FLATUSA_TEXT_TITLE', 'Flat USA Rate');
    define('MODULE_SHIPPING_FLATUSA_TEXT_DESCRIPTION', 'Flat USA Rate');
    define('MODULE_SHIPPING_FLATUSA_TEXT_WAY', 'Best Way');
    ?>

  9. #9
    Join Date
    Sep 2008
    Location
    Texas
    Posts
    6
    Plugin Contributions
    0

    Default Re: error with cloned shipping module

    Do I need to change anything in
    admin/modules.php

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: error with cloned shipping module

    The error is saying flatapofpo and you are showing us the flatusa ...

    Make sure, on the server, that the code file(s) are in the:
    /includes/modules/shipping

    and that the language file(s) are in the:
    /includes/languages/english/modules/shipping
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

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. Problems with cloned Shipping Module
    By RadarGraphics in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 11 Nov 2008, 07:24 PM
  4. Error installing cloned zone shipping module
    By shocker in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 16 Aug 2007, 04:15 AM
  5. Error with cloned flat module
    By earmsby in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 29 Nov 2006, 04:00 PM

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