Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12
  1. #11
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,940
    Plugin Contributions
    96

    Default Re: php help please - set variable based on items on order

    Quote Originally Posted by philip937 View Post
    Hi lat9.

    So I have everything working perfectly on a test file. However, when I include the code to the checkout process I get the following error:

    [13-Aug-2014 16:58:02 UTC] PHP Fatal error: Call to a member function Execute() on a non-object in /home/site/public_html/includes/mycode-includes.php on line 285

    I include the code using the following:
    include('includes/mycode-includes.php');

    this file is included directly after the sending of emails in the includes/classes/order.php file

    This works for my code I already had previously but it doesn't seem to like the new code.

    Its worth noting that code I previously used never used the execute function hence why I haven't had this error before. When I look at the code in the order.php file there are many times it is using the Execute function so I am a little confused why its not liking it?

    Any ideas?

    Thanks

    Phil
    Since your code is now running within a function, make sure that you've got 'access' to the $db class; add the following to your new module:
    Code:
    global $db;

  2. #12
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: php help please - set variable based on items on order

    Quote Originally Posted by lat9 View Post
    Since your code is now running within a function, make sure that you've got 'access' to the $db class; add the following to your new module:
    Code:
    global $db;
    yey I was right. thanks for confirming. Now seems to be working :)
    Phil Rogers
    A problem shared is a problem solved.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 6
    Last Post: 29 Aug 2012, 12:28 PM
  2. Which php variable calls for Total Items in Cart?
    By samar777 in forum General Questions
    Replies: 8
    Last Post: 24 Sep 2010, 09:59 PM
  3. Modify items in existing order or variable pricing
    By DocRocks in forum General Questions
    Replies: 5
    Last Post: 29 Oct 2009, 11:21 PM
  4. help finding Category Variable please :)
    By ink in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 15 Aug 2009, 01:02 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