close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Continue shopping doesn't work after changing to cookies

Thread began 11/13/2009 7:25 am by coryctaylor390938 | Last modified 9/08/2011 7:19 am by newparadigmmedia426729 | 3584 views | 12 replies |

coryctaylor390938

Continue shopping doesn't work after changing to cookies

I have tried several fixes from other posts.

adding this:
<?php
// WA eCart Redirect
if ($whichwatchdesigns->redirStr != "") {
session_commit();
header("Location: ".$whichwatchdesigns->redirStr);
}
?>
Did I put the session commit in the right place?

adding this to the top of the cart page:
<?php if(!session_id()) session_start(); ?>
That didn't do anything, maybe there is something I am supposed to change with this one?

I have the site on an old domain cart.php

Any help would be appreciated

Sign in to reply to this post

Jason ByrnesWebAssist

try adding the following at line 1 of the cart.php page:

php:
<?php

error_reporting
(E_ALL);
ini_set('display_errors','on');
?>



to make sure there is not a php error occurring.

also add the following just before the </body> tag to make sure the session is being set properly:
<pre><?php var_dump($_SESSION); ?></pre>

Sign in to reply to this post

coryctaylor390938

I added the code and this is what comes up when I click continue shopping:
Notice: Undefined variable: _SESSION in /...../cart.php on line 133
NULL

If I click clear cart I get this displayed:
Warning: Cannot modify header information - headers already sent by (output started at /...../cart.php:5) in /....../WA_eCart/whichwatchdesigns_PHP.php on line 292

I had everything running fine with sessions, then changed it to cookies in the ecart object. Is there something else I should have done?

Sign in to reply to this post

Jason ByrnesWebAssist

Is there a specific reason you changed to using cookies?


In reality, setting the cart to be cookie based is not a great idea, there a re a number of limitations to using a cookie based cart. The biggest limitation to using a cookie based cart is that cookies have a maximum size. You will only be able to add so many items to the cart before the maximum cookie size is reached.

This maximum size is different for each brow3ser, so there is no real way to anticipate when that size is reached.

Officially, the limits of using cookies are:
* 4 KB per cookie maximum
* 300 total cookies, for a total of 1.2 Mbytes maximum
* 20 cookies accepted from a particular server or domain

388.htm




Unless you absolutely must use cookies for your cart, I dont recommend it.

Sign in to reply to this post

coryctaylor390938

I just want the items placed in the cart to remain there if the shopper closes the browser. Many times people will place items in the cart and not buy them at that time but come back and purchase later, or if they accidentally close the browser the items are cleared from the cart. It would be nice if they didn't have to search for the items again. Is there some other way to achieve this? It is not absolutely necessary. I have everything set up as static with no database or user login.

Sign in to reply to this post

Jason ByrnesWebAssist

in the WA_eCart/WA_eCart_Definition_PHP.php file add the following at line 1:
<?php if(!session_id()) session_start(); ?>


See this knowledge base article for information on the headers already sent error:148/

Sign in to reply to this post

newparadigmmedia426729

Very frustrated

Getting this error

Warning: Cannot modify header information - headers already sent by (output started at /home/churchli/public_html/churchlife/cart.php:12) in /home/churchli/public_html/churchlife/cart.php on line 254

tried to delete white spaces
tried to add the commit
tried adding the code above to line 1
tried just about everything

I'm really getting tired of the complications...

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the cart.php file in a zip archive so i can see the code please,

Sign in to reply to this post

newparadigmmedia426729

Here we go

Here's the file, error is now on line 192

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

Jason ByrnesWebAssist

in the file you sent, all of the code is double spaced, in other words that is causing there to be a blank line every other line, having the code be double spaced like will pretty much ensure that there is a blank line after every closing php tag "?>" and the next opening php tag "<?php" which will cause the headers already sent 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...