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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Linking Add to Cart

Thread began 3/14/2011 12:57 am by stprix49407889 | Last modified 3/28/2011 10:16 am by Jason Byrnes | 1991 views | 11 replies |

stprix49407889

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

Attached Files
EcartMarch18_2010.txt
Sign in to reply to this post

Jason ByrnesWebAssist

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.

Sign in to reply to this post

stprix49407889

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

Sign in to reply to this post

Jason ByrnesWebAssist

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');
?>

Sign in to reply to this post

stprix49407889

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

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

Jason ByrnesWebAssist

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.

Sign in to reply to this post

stprix49407889

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.

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

Jason ByrnesWebAssist

move lines 9 - 14:

php:
<?php

// WA eCart Redirect
if ($eSurvivalcart->redirStr != "")     {
  
header("Location: ".$eSurvivalcart->redirStr);
}
?>




to line 195, just before the doctype tag.

Sign in to reply to this post

stprix49407889

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

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

Jason ByrnesWebAssist

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.

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