Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Location
    Worcester, MA
    Posts
    453
    Plugin Contributions
    0

    Default cloned table shipping in v.1.5.5

    Hi!

    I'm in the process of upgrading a client's store from 1.5.4 to 1.5.5a. He uses cloned table rate shipping (table is cloned to usaground, usa2day, canadaair, etc.) I've done this many times and figured this wouldn't be much of a big deal to duplicate in this upgrade. But I noticed a key change in the table shipping module file. The line near the top of the file that used to say:

    Code:
    function table() {
    now says:

    Code:
    function __construct() {
    In the past when I cloned the table file for other methods, I would change
    Code:
    function table()
    to
    Code:
     functio usaground()
    (or whatever the clone was). Should I change all the other instances of "table" but just not that first line?

    I'm a bit confused!

    Thanks!
    Ellie Armsby

  2. #2
    Join Date
    Oct 2006
    Location
    Worcester, MA
    Posts
    453
    Plugin Contributions
    0

    Default Re: cloned table shipping in v.1.5.5

    I went ahead and cloned everything else but left the
    Code:
     function __construct() 
    line and that seems to have worked. So, just reporting back in case anyone else is upgrading with cloned shipping files. :)
    Ellie Armsby

  3. #3
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: cloned table shipping in v.1.5.5

    Unfortunately no one got back to you to explain why that was a good idea/method.

    As of one or more of the earlier PHP 5.x versions, a class (something like a data structure that can have its own features applied to it) could be declared (initialized) using a function that more clearly indicates it's purpose. In this case to construct the class. Before this time, the class was initiated by a function having the same name as the class.

    Currently this "older" method still works even in PHP 5.6, but in PHP 7.0 (ZC 1.5.5 is compatible with it), the use of the class to initiate the function is now considered a separate function and in certain conditions will cause an error. So in order to maintain compatibility of your code moving forward, use of __construct() just after the class is named is the "better" way to go.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v151 Cloned table shipping module not showing zone selector
    By earmsby in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 17 Oct 2013, 06:29 PM
  2. Cloned table rates with zones - is this possible?
    By petersonfenn in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 24 Nov 2011, 10:48 AM
  3. Question on cloned table shipping modules and 1.3.9 upgrade
    By earmsby in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 16 Jun 2010, 03:42 PM
  4. Cloned Table rate by price: only honors first shipping amount
    By creativearc in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 27 Jun 2008, 05:22 PM
  5. Cloned Table Rate Shipping 1146 Error
    By pillaroom in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 8 Mar 2008, 07:15 PM

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