Page 1 of 2 12 LastLast
Results 1 to 10 of 23

Hybrid View

  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
    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

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

    Default Re: Cloned shipping module problem

    I've quoted the first post from this thread as this is what is happening again.
    Only difference now is the mistake found earlier is now not the cause
    Quote Originally Posted by psr racing View Post
    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?

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

    Default Re: Cloned shipping module problem

    I don't really know how to tell you this. If the class cannot be redeclared, this is because the class has already been initiated once already. I suggest you find out where the line

    class storepickup

    exists within your store code, and go from there.

    Using the Developer's Toolkit in the admin, under tools, paste "class storepickup", without the "s, into the last textbox, and select Catalog from the dropdown, and tehn click search. Please paste here EXACTLY what the return fines.

    Absolute

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

    Default Re: Cloned shipping module problem

    /home/pow10934/public_html/includes/modules/shipping/storepickup.php
    Line #12 : class storepickup extends base {


    I did the same for "class cod" and got

    /home/pow10934/public_html/includes/modules/payment/cod.php
    Line #22 : class cod {
    /home/pow10934/public_html/includes/modules/shipping/cod.php
    Line #12 : class cod extends base {

 

 
Page 1 of 2 12 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

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