Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default [Not a bug] table structure problem

    While working on one of my sites that doesn't use a database prefix, I ran across the following error:

    occurs from
    admin -> customers -> paypal IPN

    after displaying the customer information page, if you click on the "orders" button
    the following error displays

    1054 Unknown column 'zen_order_id' in 'where clause'
    in:
    [select * from paypal where zen_order_id = '1251' order by paypal_ipn_id DESC LIMIT 1]


    As I said the database doesn't use a prefix and the paypal table contains a row named order_id

    I fixed the problem by deleting the "zen_" from several places in
    includes/modules/payment/paypal.php and paypalwwp.php

    Is it possible to fix this for future versions in cases where a database doesn't use a prefix.

    perhaps something like:

    $sql = "select * from " . TABLE_PAYPAL . " where . DB_PREFIX . "order_id = '" . (int)$zf_order_id . "' order by paypal_ipn_id DESC LIMIT 1";

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: paypal.php, paypalwpp.php needs fixing

    Clyde have you applied the most recent patch for the PayPal files?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

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

    Default Re: paypal.php, paypalwpp.php needs fixing

    Check your paypal table that is a real field ...
    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
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: paypal.php, paypalwpp.php needs fixing

    Quote Originally Posted by Ajeh View Post
    Check your paypal table that is a real field ...
    on the site that uses no prefix the paypal table contains order_id

    on other sites I work on Those with a zen_ prefix the paypal table contains zen_order_id.

  5. #5
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: paypal.php, paypalwpp.php needs fixing

    Quote Originally Posted by Kim View Post
    Clyde have you applied the most recent patch for the PayPal files?

    Yep, done that also. last patch was 21 March.

    I need to point out that I didn't set up the site initially, I was asked to fix several problem that cropped up afterward.

    This was one of them.

  6. #6
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: paypal.php, paypalwpp.php needs fixing

    on the site that uses no prefix the paypal table contains order_id
    You are mistaken. You can see origin zc_install/sql/mysql_zencart.sql:
    Code:
    ...
    CREATE TABLE paypal (
      paypal_ipn_id int(11) unsigned NOT NULL auto_increment,
      zen_order_id int(11) unsigned NOT NULL default '0',
    ...

  7. #7
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: paypal.php, paypalwpp.php needs fixing

    Quote Originally Posted by a_berezin View Post
    You are mistaken. You can see origin zc_install/sql/mysql_zencart.sql:
    Code:
    ...
    CREATE TABLE paypal (
      paypal_ipn_id int(11) unsigned NOT NULL auto_increment,
      zen_order_id int(11) unsigned NOT NULL default '0',
    ...
    Andrew,

    No, I checked the database table and it is order_id.

    As I said I didn't do the initial set up of the site I only got involved to troubleshoot several problems that cropped up after the installation.

    I suppose I can fix the table.

  8. #8
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: paypal.php, paypalwpp.php needs fixing

    Quote Originally Posted by clydejones View Post
    Andrew,

    No, I checked the database table and it is order_id.

    As I said I didn't do the initial set up of the site I only got involved to troubleshoot several problems that cropped up after the installation.

    I suppose I can fix the table.

    Resolved.

    I renamed order_id to zen_order_id re_installed the most recent paypal patch


    evidently the original installer thought that "zen_" was a prefix to match the database prefix. Since a prefix hadn't been used for the database it was just deleted from order_id.

    Anyway everything working fine now.

    Thanks All

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

    Default Re: paypal.php, paypalwpp.php needs fixing

    Thanks for the update ...

    I have done that in a hasty global replace forgetting about the couple three fields that start with zen_ on the paypal tables ... then wondered why the code stopped working ...
    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. Replies: 3
    Last Post: 3 Jan 2014, 05:22 AM
  2. DB Table Structure for Linked Prods?
    By Tapper in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 17 Jul 2008, 07:26 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