close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Fatal error: Call to a member function GetContent() on a non-object in confirm.php

Thread began 10/20/2011 11:04 am by michael271305 | Last modified 11/07/2011 1:19 pm by Jason Byrnes | 5480 views | 19 replies |

michael271305

Fatal error: Call to a member function GetContent() on a non-object in confirm.php

Hi

I have been trying to configure an eCart installation utilising Paypal as the gateway.

When I uploaded to my live space I can select items and see them in the cart. I can also proceed to the first checkout page which asks for name, email, address etc.

On clicking the checkout button I get the error as shown in the title. The full text is shown below:

[start]
Fatal error: Call to a member function GetContent() on a non-object in /home/<myaccountnamehere>/public_html/vitscartdemo/confirm.php on line 7
[end]

The path is where the confirm.php is stored on my web server.


I am unsure what this means as I am not a highly proficient php coder.

Any help appreciated as this is for a customer who asked for this addition to a brochure type site.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

this error usually happens if you have named the database connection and the eCart object the same.

make sure to use unique name for all application objects like connection, recordset and eCart object.


if you continue to have a problem, what is the code for the first 10 lines of the confirm.php page?

Sign in to reply to this post

michael271305

Hi Jason

Thanks for responding so quickly.

Tried updating the connections file name so that it differed from 'vitscartdemo' which is the title I had used throughout but still get the error. Dreamweaver did update confirm.php and pp_confirm.php to reflect the changed file name.

Top lines from the confirm.php file are as follows:

[start]
<?php
//WA eCart Include
require_once("WA_eCart/vitscartdemo_PHP.php");
?>
<?php require_once('Connections/vitscartsystem.php'); ?>
<?php
//Tried changing $vitscartdemo to $vitscartsystem but no joy
$vitscartdemo->GetContent();
?>
<?php
//WA eCart Include
require_once("WA_eCart/WA_eCart_Database_PHP.php");
?>
[end]

Thanks

Michael

Sign in to reply to this post

Jason ByrnesWebAssist

just changing the file name of the connection file will not fix the problem.

you will need to go to the database tab and create a new connection with the new name, then change the connection require once line to point to the new connection file that is created.

Sign in to reply to this post

michael271305

Hi Jason

Thanks for your patience.

I deleted and re-created everything making sure not to use the same name for the various aspects.

Good news is I was able to process a payment via Paypal.

Unfortunately, this has raised some additional questions.

1) Although I set the cart object to use British Sterling the Paypal system processed the test payment as $0.01 instead of £0.01. My PayPal account is configured for British Sterling as I am resident in the UK. I didn't see any other option for setting British Sterling except the one for the e-cart object.

I know PayPal send emails to the sender (customer) and recipient (business) detailing the transaction but when I configure a cart for my client this will use Sage Pay instead.

2) I have Universal Email 4 installed and activated but when I performed the Checkout step it skipped the email creation. I really need this to work so that both the shop owner and the customer get a copy of the order.

3) When the processing at Paypal completed there was no return to the checkout_success.php page. How is this done?

Thanks

Michael

Sign in to reply to this post

Jason ByrnesWebAssist

1) on the confirm page, look for the following tag:
<input type="hidden" name="currency_code" id="currency_code" value="USD" />

and change it to:
<input type="hidden" name="currency_code" id="currency_code" value="GBP" />


2) Using PayPal Standard, it will not configure the email receipt. PayPal Payments standard is a remote payment gateway, using a remote payment gate, you will need to rely on the gateway to send the receipt.


3) on the confirm page, find the following code:
<input type="hidden" name="return" id="return" value="" />


and set the full address for the return page:

<input type="hidden" name="return" id="return" value="http://www.mydomain.com/checkout_success.php" />

Sign in to reply to this post

michael271305

Hi Jason

Almost there :)

I now have a system where items can be added to a cart, checkout completed (to which I have added validation checks to key fields), payment processed at Paypal and the visitor given the link back to the site.

Two issues remain:

1) I take it the Order success page will auto display the order just completed? I am currently testing on WAMP so this does not work as a return address in development. It would be good if the client could print the order while on screen.

2) My remaining concern is the issue of emails.

When I check the email issued by PayPal it only has basic name information. This is okay for the client but for the business there is a need to receive the full contact details as well as the order information as follow up is needed to arrange delivery (it's a skip hire business so dates etc need to be agreed).

Is there anyway I can use the email confirmations within the eCart system to issue the necessary emails rather than depend on Paypal or the intended Sage Pay gateway.

Thanks

Michael

Sign in to reply to this post

Jason ByrnesWebAssist

What PayPal System Are you using?

What Sage Pay System will you be using?

Sign in to reply to this post

michael271305

It would be Paypal Website Payments standard and Sage Pay Form Protocol.

The client has not yet decided if they want Paypal as one of their options in the final solution but I would just use the express checkout option for this.

Sign in to reply to this post

Jason ByrnesWebAssist

The main difference with PayPal Payments standard is that Payments standard is not a real time gateway.

What this means is that when the user is returned to the your site to the success page, it only means that the payment method was accepted by the paypal server. at this point the transaction has not been sent to the merchant bank.

PayPal uses a system called IPN (Instant Payment Notification), this send a post to a page you set up on your site when the transaction goes through the merchant bank with the success or failure result. for more details on IPN, see the following page:
ipn

you could configure the IPN page to send an email using Universal Email with the cart contents on payments success


with Sage Pay VSP form method, this is a real time gateway, so you could add universal Email to the checkout success page to send the cart contents.

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...