close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Error in email receipt

Thread began 7/15/2010 7:46 pm by AlaskaTom | Last modified 8/04/2010 12:31 am by Dave Buchholz | 6598 views | 16 replies |

AlaskaTomBeta Tester

Error in email receipt

I have a cart built with eCart 5. I am using UE4 to send an email receipt.
I created a page in DW, and applied an email friendly cart to that page, and saved it.
Then, on my eCart success page, I applied UE4, and told it to use that page I just put the email friendly cart on as the email content.

However, when I go through checkout, I get an error
PHP Fatal error: Call to a member function GetContent() on a non-object on line 6
on my email-receipt.php page.

However, the page works fine if I view it directly in a browser (shows my cart etc) however, when the checkout success page calls it via a UE server behavior, it throws that error.
These are the lines at the top of the receipt page
<?php
//WA eCart Include
require_once("WA_eCart/eCart1_PHP.php");
?>
<?php
$eCart1->GetContent();
?>

It finds the include file file, but throws an error when I try to access the object.
Why?

Thanks
Tom

Sign in to reply to this post

Eric Mittman

Could you post back with the success page that is giving you the error and the specific page that has the code on it from UE. I would like to take a look to see if I can spot the issue in the code itself.

Sign in to reply to this post

AlaskaTomBeta Tester

Eric,
Here is the success page, the emial receipt page, and the UE includes from inside the webassist folder.

Thanks!
Tom

Attached Files
harbinger.zip
Sign in to reply to this post

Eric Mittman

If that is the exact error you are getting it seems very confusing to me. The include for the cart file should include another require once for the cart definition file. The definition file is where this function should be defined.

Perhaps you should try adding in a require once for the cart definition file to ensure that it is included before the call to GetContents. Here is what the require once should look like:

php:
require_once("WA_eCart_Definition_PHP.php");



I have not ever seen before where a php page throws an error about the function if it has been defined. It seems like either the include is being ignored, or that the file, or code for that file is not present. Here is what the function call looks like in the file:

php:
function GetContent() {

    if ($this->PersistanceType == 0)     {     //Session
      $this->Items          = $this->Session_GetContent();
    }
    if ($this->PersistanceType == 1)     {     //Cookie
      $this->Items          = $this->Cookie_GetContent();
    }
}
Sign in to reply to this post

AlaskaTomBeta Tester

Yes, it is a puzzler, which is why I posted :-)

I was thinking it was perhaps a path issue, since the require_once were called inside of a function, but even changing all paths to server root relative didnt work. Also, since they were requires, it would cause a fatal error if it couldnt find the definition file.

Perhaps they are require_once, and called first on the parent page, is the problem?

I added your suggested require_once to the definition file, but added its parent folder WA_eCart/ and it found it fine, but still threw the error. Like I said, I even tried full server root relative paths, and no luck.

The exact error I am receiving is (with account name changed)
Notice: Undefined variable: eCart1 in /home/accountname/public_html/email-receipt.php on line 7

Fatal error: Call to a member function GetContent() on a non-object in /home/accountname/public_html/email-receipt.php on line 7

(the error is on line 7 now, instead of 6, because I added the new require_once to the definition)

Any more ideas?

I really need to get this figgured out today, since you guys are off on the weekend.

Thanks!
Tom

Sign in to reply to this post

Eric Mittman

As a temporary work around you should try updating the require once line on this page to be an include() function call. The path should not need to be updated. If the script thinks that the file has already been included adding this include should force it to try and include the file again. If you get an error about the file having already been included you can add an @ in front of it like this:

[php]
@include("WA_eCart/eCart1_PHP.php");
[/php

Please give this a try to see if you get past the problem. Post back and let us know how it goes.

Sign in to reply to this post

AlaskaTomBeta Tester

Good idea, but Ive been down this road already :-)

I tried that, and it complained :
Fatal error: Cannot redeclare class eCart1_Definition in /home/accountname/public_html/WA_eCart/eCart1_PHP.php on line 256

Then I tried including the definition file only, and got:

Fatal error: Cannot redeclare WA_eCart_WeightConversion() (previously declared in /home/accountname/public_html/WA_eCart/WA_eCart_Definition_PHP.php:514) in /home/accountname/public_html/WA_eCart/WA_eCart_Definition_PHP.php on line 605

So, since all those things are supposedly already defined, I removed the include, or require_once from the top of that page, then I am back to the original error

Fatal error: Call to a member function GetContent() on a non-object in /home/accountname/public_html/email-receipt.php on line 2

except, line 2, since I removed the includes lines.

What the heck?? If I try do include, it complains that I cant redeclare, but if I dont, it complains the function doesnt exist...

Back to square one...

Sign in to reply to this post

Eric Mittman

It seems that the error makes even less sense after this round of testing. What happens if you include only the cart definition file, but move the GetContents function so that it is the first one listed in the file?

If you can do this and get a message that says you can't redeclare the function then there must be something else going on that we are not thinking about.

Sign in to reply to this post

AlaskaTomBeta Tester

Eric,
That is exactly what is happening.
If I 'include' (as opposed to require_once) the definition, it throws the error:

Fatal error: Cannot redeclare WA_eCart_WeightConversion() (previously declared in /home/accountname/public_html/WA_eCart/WA_eCart_Definition_PHP.php:514) in /home/accountname/public_html/WA_eCart/WA_eCart_Definition_PHP.php on line 605


and never even gets to the $eCart1->GetContent(); line

I cant be the only person though that uses eCart to send an email receipt, and uses an external file to do it?

This is something that I was really looking forward to in UE4, as it makes it MUCH easier to edit and customize the email receipts.

Definitely a strange error!

Tom

Sign in to reply to this post

Eric Mittman

I have opened a ticket for you on this issue so it can be looked into further. Did you ever go into this definition file and move the get contents function to the top of the page? What happens when you do that? If you get the same error about the weight conversion being redeclared then it would seem that the file was included but the get contents was not a part of it.

If you can move the get contents function to the top of this file and do not get an error about the get contents being redeclared then you might want to try making a copy of this file minus everything after the get contents function at the top of the file. If this did work for you it would just be a temporary fix.

Make sure that you update your ticket with any important details or access to the server so that we can look into this further.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...