Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1
    Join Date
    Feb 2007
    Posts
    90
    Plugin Contributions
    0

    Default Cloned shipping module problem

    I just attemted to clone a shipping module (storepickup) to create an identical module (COD). I went through and changed 'storepickup' to 'cod' and 'STOREPICKUP' to 'COD' in both the relevant files but now i get this error under the Admin/ shipping modules
    Fatal error: Cannot redeclare class storepickup in /home/pow10934/public_html/includes/modules/shipping/storepickup.php on line 13

    I cant work out where I went wrong, especially as line 13 doesn't seem relevant to the operation of the file?
    Also the 'storepickup' module now doesnt show under 'shipping modules' and the 'COD' module is showing as MODULE_SHIPPING_COD_TEXT_TITLE instead of just 'COD'
    Storepickup still shows up as an option to shoppers though?

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

    Default Re: Cloned shipping module problem

    When you say you changed the 'storepickup' to 'cod', there should have been 3 of these to change. There is a class xxxxx extends base, a function xxxx { and a this->code = 'xxxx' to change.

    Did you do all three?

    You also need to ensure the new file is called cod.php, as the class name is pulled from the file name.

    Absolute

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

    Default Re: Cloned shipping module problem

    I'm sorry you've lost me. I cloned admin/includes/modules/shipping/storepickup.php and admin/includes/languages/english/modules/shipping/storepickup.php is there another one?

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

    Default Re: Cloned shipping module problem

    Those are the correct files.but they are in the store side, not the admin side of the cart.

    Within the actual file, there are 3 places where you need to change the work "storepickup" to "cod". Those are listed above.

    Absolute

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

    Default Re: Cloned shipping module problem

    There was a lot more than 3, I went through and changed every instance of 'storepickup' to 'cod' in both files.

  6. #6
    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
    There was a lot more than 3, I went through and changed every instance of 'storepickup' to 'cod' in both files.

    Fatal error: Cannot redeclare class storepickup

    Hello,

    Can you post your "COD" module code? .... If so I think we probably could spot the problem pretty quickly. From the error message I would say you didn't rename the class on the new module...

    Shrimp-Gumbo

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

    Default Re: Cloned shipping module problem

    Did you create a language file for the new module?

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

    Default Re: Cloned shipping module problem

    OK I see now, the files are at public_HTML/includes/modules/shipping/storepickup and public_HTML/includes/languages/english/modules/shipping/storpickup.php

    they were the ones I changed

  9. #9
    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');
    ?>

  10. #10
    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

 

 
Page 1 of 3 123 LastLast

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

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR