Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2014
    Location
    Kitchener, Ontario
    Posts
    6
    Plugin Contributions
    0

    Default 1064 when clicking paypal checkout button and not logged in as a user

    Hello

    This is an unusual problem, and probably doesn't belong here (apologies in advance),, I would like to ask if anyone could point me in the right direction.

    My zencart has been customized, the original programmer MIA, trying to find problem myself, I have limited knowledge of php or sql, but learning.

    When clicking on the Checkout with PAYPAL button (not logged in as a user) - I get an error page:

    WARNING: An Error occurred, please refresh the page and try again.

    Reading through these forums, I learned to check the error logs and here is what I have:

    PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 :: select `customers_whole` from `customers` where `customers_id` = in /home3/kwmagicc/public_html/includes/classes/db/mysql/query_factory.php on line 120

    I looked at that file and could not see the problem, not that I was expecting it to jump out and bite me, but I fear I am looking at the wrong file.

    Now I assume it has something to do with the wholesale pricing module not coded correctly, but could use a little guidance as to where to check next.

    Any help appreciated

    Phil

  2. #2
    Join Date
    Apr 2014
    Location
    Kitchener, Ontario
    Posts
    6
    Plugin Contributions
    0

    Default Re: 1064 when clicking paypal checkout button and not logged in as a user

    tracking it down to a piece of custom code maybe - I can't see the problem:

    /*------------------------------Whole sale customer code-------------------*/
    $customer_whole_obj = $db->Execute('select `customers_whole` from `'.TABLE_CUSTOMERS.'` where `customers_id` ='.$_SESSION['customer_id']);
    $customer_whole = $customer_whole_obj->fields['customers_whole'];
    if($customer_whole == 4){
    $_SESSION['customer_level'] =4;
    //print_r($_SESSION);
    if($_SESSION['payment'] == 'paypalwpp' || $_SESSION['payment'] =='cc'){
    $this->info['charges'] = 2.5;
    $this->info['total_without_charges'] = $this->info['total'];
    $this->info['charges_amt'] = ($this->info['total'] * $this->info['charges'])/100;
    $this->info['total'] = $this->info['total'] + $this->info['charges_amt'];
    }
    }
    /*------------------------------End Whole sale customer code-------------------*/

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 1064 when clicking paypal checkout button and not logged in as a user

    Try changing this:
    Code:
    $customer_whole_obj = $db->Execute('select `customers_whole` from `'.TABLE_CUSTOMERS.'` where `customers_id` ='.$_SESSION['customer_id']);
    to this:
    Code:
    $customer_whole_obj = $db->Execute('select customers_whole from '.TABLE_CUSTOMERS.' where customers_id ='.(int)$_SESSION['customer_id']);
    .

    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.

 

 

Similar Threads

  1. v154 blank page when clicking checkout or paypal button in shopping cart
    By DarkAngel in forum Upgrading to 1.5.x
    Replies: 10
    Last Post: 16 Jun 2015, 11:35 PM
  2. page can not be found when clicking on checkout button
    By Robert Perelman in forum General Questions
    Replies: 5
    Last Post: 5 Dec 2010, 03:09 PM
  3. PayPal Express button not showing on logged in Checkout
    By Dunk in forum Built-in Shipping and Payment Modules
    Replies: 10
    Last Post: 28 Apr 2010, 10:57 PM
  4. How do I show quantity discounts when user not logged in?
    By carystevens in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 21 Jul 2009, 04:56 AM
  5. 1064 error happened by clicking check-out button
    By Yukiko in forum Basic Configuration
    Replies: 12
    Last Post: 21 Jul 2006, 07:10 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