Results 1 to 9 of 9
  1. #1
    Join Date
    May 2013
    Location
    Black Forest, CO
    Posts
    12
    Plugin Contributions
    0

    Default Bug in TheSecureGateway module

    I migrated to a new payment gateway, The Secure Gateway and when I implemented it on 1.3.9, I got a zones table error. So I went ahead and upgraded my site to 1.5.0. here is the error I now get at checkout:

    PHP Fatal error: 1146:Table 'DB******.zones' doesn't exist :: select zone_code from zones where zone_name like '%Colorado%' in /home/content/34/7174734/html/zencart_new/includes/classes/db/mysql/query_factory.php on line 101.

    Not sure how to get past this. The site seems to hang at the Checkout process.

    Any help or suggestions would be appreciated. I am late getting the site up for our summer activities.

    Thanks,

    Jeff

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Help! Error on checkout points to Zones table.

    You replaced part of the DB info with ******. But that's critical information needed to help you.
    Can you reply with the details of the part you replaced with ******* ?

    Also, what is the value of DB_DATABASE and DB_PREFIX in your /includes/configure.php file? They are not sensitive information, so are safe to post. (We don't need the DB_USERNAME or DB_PASSWORD, which *are* sensitive info.)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2013
    Location
    Black Forest, CO
    Posts
    12
    Plugin Contributions
    0

    Default Re: Help! Error on checkout points to Zones table.

    Hi Dr. Byte, Sorry for the lack of information.

    DB = bfc1211403234954

    DB_DATABASE = bfc1211403234954

    DB_PREFIX = 'DB_PREFIX', 'zen_'


    I suspect i know what the problem might be now. Please confirm what the PREFIX should be? is that the only issue, do you think?

    Thanks for the help,

    Jeff

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Help! Error on checkout points to Zones table.

    All Zen Cart core code uses tablenames like TABLE_ZONES and TABLE_ORDERS_STATUS_HISTORY which are constants defined as a combination of DB_PREFIX and the actual name of the table used without a prefix. This allows stores to have a table-prefix (defined by DB_PREFIX) to help differentiate between multiple ZC stores sharing a single database.
    Some modules/plugins are poorly written and just hard-code the actual tablename without regard to prefix, and thus trigger the kind of error message you're reporting when running on stores such as yours which have been installed using a non-blank DB_PREFIX like yours.

    So, whatever non-original-core-code you've added to your site is likely the culprit, and needs updating to use the correct tablename constant. They're all listed in /includes/database_tables.php as far as core code tables go.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    May 2013
    Location
    Black Forest, CO
    Posts
    12
    Plugin Contributions
    0

    Default Re: Help! Error on checkout points to Zones table.

    Thanks for that info. I didn't see anything in includes / database_tables.php that looked out of the ordinary.

    The only change that was really made was the switch the new payment gateway, The Secure Gateway. Previously, I was using Authorizenet. is it possible that there is a hard coded "authorizenet" pointer where "the Secure Gateway" should go. I had no problems up until the switch. The folks at Newtek can't seem to identify their gateway as the source fo the problem.

    Maybe someone is familiar with that gateway.....

    Thanks,

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Help! Error on checkout points to Zones table.

    Attach a zip file containing the files for that module, and we can look at it. Or post a URL where it can be downloaded.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    May 2013
    Location
    Black Forest, CO
    Posts
    12
    Plugin Contributions
    0

    Default Re: Help! Error on checkout points to Zones table.


  8. #8
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Help! Error on checkout points to Zones table.

    Yes, as I suspected. This part of the code is not written to support tablename prefixes:
    Code:
    function get_state_abbr($state_desc) {
            global $db;
            $states = $db->Execute("select zone_code from zones where zone_name like '%" . $state_desc . "%'");
            while (!$states->EOF) {
                return $states->fields['zone_code'];
            }
            return $state_desc;
        }
    It would need to be changed to:
    Code:
    function get_state_abbr($state_desc) {
            global $db;
            $states = $db->Execute("select zone_code from " . TABLE_ZONES . " where zone_name like '%" . $state_desc . "%'");
            while (!$states->EOF) {
                return $states->fields['zone_code'];
            }
            return $state_desc;
        }
    You should also work directly with their technical support team to make correct adjustments to the following lines. If you don't, then your payment transactions are not being handled securely, and you run the risk of credit card theft:
    Code:
            curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
            curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    May 2013
    Location
    Black Forest, CO
    Posts
    12
    Plugin Contributions
    0

    Default Re: Help! Error on checkout points to Zones table.

    Thanks so much for that information. I will forward that on to them. Interestingly, even with my very limited knowledge, I pointed out to them that this area might be part of the issue since the error line was in there. Their initial response was to have me comment it out. Which, of course, did not work either.

    So, I will get this back to them to make the correction in their includes.

    Thanks again!!!!!!


    Jeff

 

 

Similar Threads

  1. v151 PayPal module bug
    By eugene007 in forum Upgrading to 1.5.x
    Replies: 0
    Last Post: 12 Feb 2014, 03:17 AM
  2. Eway module bug
    By emtecmedia in forum Addon Payment Modules
    Replies: 5
    Last Post: 2 Aug 2010, 06:43 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