PDA

View Full Version : Add to Cart button problem


stevesmith373400
03-30-2009, 08:12 AM
When I insert the add to cart button, the page loads blank. Before I insert the button, I can see the template and the dynamic data. The sample store, BlueSkyMusic, works fine. My test server is an apache server on my local machine. I have it set up for //localhost/. Does anyone have an idea as to why it loads a blank page?

I greatly appreciate your time and any help you can give.

Ray Borduin
03-30-2009, 08:21 AM
Most likely there is some sort of error and error reporting is turned off on the server.

Try to get error reporting turned on for development, then you can see what the error is to have a better chance of fixing it.

stevesmith373400
03-30-2009, 08:57 AM
The error reporting service is turned on. My puzzle is that the BlueSkyMusic site that I loaded for trial works perfectly. When I create the product pages for my site, they work perfectly until I insert the add to cart button. I can see the page and all my products on the localhost test server before I insert the button. After I insert the button, the page is blank and there is no source code if you view the source code from the browser. I am certain it is a simple fix with a setting but I cannot narrow it down.

Ray Borduin
03-30-2009, 10:12 AM
Even if the error reporting service is on, it may be set up to report the errors to a log file instead of on the page. This is still my best guess.

stevesmith373400
03-30-2009, 11:28 AM
Found the log. The error reads
PHP fatal error call to member function getcontent() on a non object" on line 6

we are baffled here. I cannot figure how to point the get content correctly if that is the problem.

Ray Borduin
03-30-2009, 11:56 AM
You need to have the shopping cart include file above the getContent function. It sounds like your include file may be in the wrong place.

stevesmith373400
03-30-2009, 12:04 PM
Here is the code up to the php cet content command.

<?php
//WA eCart Include
require_once("WA_eCart/aysshop_PHP.php");
?><?php require_once('Connections/aysshop.php'); ?>
<?php
$aysshop->GetContent();
?>

It is exactly like the BlueskyMusic pages except using my database. Is there another file that could be throwing the get content command off?

stevesmith373400
03-30-2009, 12:06 PM
Also when I remove the 3 lines of php code that performs the get content, my page returns and the data is there. The add to cart button does not work of course even though it is on the page.

Ray Borduin
03-30-2009, 01:07 PM
The code appears as though it should work. Are you sure you have uploaded the file:
WA_eCart/aysshop_PHP.php

Maybe try moving the connections above, but I don't see how that would make a difference.

stevesmith373400
03-30-2009, 01:22 PM
By uploading the file if you mean is it in the root directory of the site under the WA_eCart file then yes it is there. Is there another place it needs to be. At this point I am considering wiping it all and starting from the beginning. I believe that somewhere during the process a glitch was introduced that we cannot locate. Any other ideas? The "WA_eCart/aysshop_PHP.php" and the 'Connections/aysshop.php' were both created by the ecart wizard. Where would I look in those files if there were a problem?

Ray Borduin
03-30-2009, 01:54 PM
The object should be created in the include file. The error implies the eCart object is not properly created, but I'm not sure how that could happen as long as you have the entire WA_eCart folder uploaded properly.

The code looks correct that you provided, and I'm not sure of your theory on a phantom glitch... no such thing as far as I know of. The problem has to be that the eCart include files were not uploaded properly... are there any other errors associated with the page in that log file you found?

stevesmith373400
03-31-2009, 06:39 AM
Ray, thanks so much for you time yesterday. Through the help of the tech guys at web assist I, or I should say they, figured it out. I had named my cart and my connection with the same name thus confusing the program. I thought that would be easier to remember if it were the same but it cost me a whole lot of time and headache. But as I suspected it had to be a simple but hard to locate problem. I started over this am and all data and buttons are good to go. Thanks again for your time and effort. Hope this gives you another fix to log away for future novices like me.