Linking Add to Cart
How can I link my Add to Cart button to my Cart.php page, so that after clicking the button it goes to my Cart.php page.
Thanks
Serge
How can I link my Add to Cart button to my Cart.php page, so that after clicking the button it goes to my Cart.php page.
Thanks
Serge
In the add to cart button server behavior, the redirect section allows you to specify a go to page, set this to go to your cart page. See the attached screen shot.
I have updated the server behavior to redirect to cart.php and also on the binding tab I have redirected when item is added to cart. Then I got an error in local server indicating line 1 and 188. So I moved the following statement on top
<?php
// WA eCart Redirect
if ($eSurvivalcart->redirStr != "") {
header("Location: ".$eSurvivalcart->redirStr);
}
?>
below this statement
<?php
//WA eCart Include
require_once("WA_eCart/eSurvivalcart_PHP.php");
?>
which previously had been also below.
After moving it, I no longer getting an error message but when you add to Cart button it does not redirect to cart.php thought I have updated the redirects on the Foodproducts result and direct pages.
I have uploaded to the server so you can see it at:
index.php
add the following code at line 1 of your page to turn error reporting on:
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
I copy the code, though I didn't know which page to put it on so I place it on index.php, foodproducts_details and foodproduct_result, cart.php and checkout.php. I did get some errors so I zip WA_eCart\WA_eCart_Definition_PHP.php.
Thanks for your help.
Serge
that code only needs to go on line 1 of the page you added the add to cart button to:
Foodproducts_Results.php
See the following post for details on the headers already sent error:
showthread.php?t=19285
if you need further assistance, I will need a copy of the Foodproducts_Results.php page.
Thanks Jason for the link, I had an empty space on line 4 which I deleted and error is gone but I still cannot get the add to cart button to redirect to cart.php.
I have attached my foodproducts_results page.
Thanks for your help.
move lines 9 - 14:
<?php
// WA eCart Redirect
if ($eSurvivalcart->redirStr != "") {
header("Location: ".$eSurvivalcart->redirStr);
}
?>
to line 195, just before the doctype tag.
Thanks Jason,
I have removed the following statement, got another error on line 57 and I removed the empty line 56, and that error was solved.
<?php
// WA eCart Redirect
if ($eSurvivalcart->redirStr != "") {
header("Location: ".$eSurvivalcart->redirStr);
}
?>
Now I have two questions.
1) This statement you had me moved also appears in the total on Foodproducts_Details and cart.php, my question do I need to moved them also and where?
2) I now have an error message on the cart page statement Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\Esurvivalmall\cart.php:5) in C:\xampp\htdocs\Esurvivalmall\WA_eCart\WA_eCart_Definition_PHP.php on line 465
I have zip these pages and if you need to look at the website it is:
index.php
cart.php
Thanks for your help.
Serge
1) That code needs to be just before the doc type tag. If it is not just before the doctype tag on those pages, it needs to get moved.
2) The error is caused by a blank space at the end of line 4. on line 4, you have:
"?> "
that blank space after the closing php tag is causing the error.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.