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

Clear cart clears everything or nothing

Thread began 4/30/2012 5:41 pm by rgolab68503 | Last modified 5/01/2012 6:47 pm by rgolab68503 | 514 views | 4 replies

rgolab68503

Clear cart clears everything or nothing

When I add the clear session values to my page I can get it to clear everything by checking the box to "clear all sessions". However, if I select only the cart items in the window nothing gets cleared.

When looking through the forums i came across a similar issue and tried adding the suggestions to save and and restore so my code now looks like this.

<?php
$loginUsername = $_SESSION['user_name'];
$password = $_SESSION['pass_word']
?>
<?php
@session_start();
if ("" == ""){
// WA_ClearSession
$clearAll = TRUE;
$clearThese = explode(",","");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>
<?php session_start();
$_SESSION['user_name'] = $loginUsername;
$_SESSION['pass_word'] = $password;
?>

This however still logs me out. Am I missing something in the restoring of the username and password?

I tried simply using the clear cart function before page load but it just stalls the page for some reason.

<?php
// WA eCart Trigger Clear Cart
if ("" == "") {
$ToyoeCart->ClearCart();
$Redirect_redirStr="checkout_success.php";
if ($Redirect_redirStr != "") {
$ToyoeCart->redirStr = $Redirect_redirStr;
}
$ToyoeCart->cartAction = "ClearCart";
}
?>
<?php
// WA eCart Redirect
if ($ToyoeCart->redirStr != "") {
header("Location: ".$ToyoeCart->redirStr);
}
?>

Ideally what it needs to do is clear the cart however not clear the log in session variables so the visitor can continue to do other activities.

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