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

rating

deleting cart session on page load

Thread began 8/13/2014 1:57 pm by Christopher West | Last modified 8/13/2014 2:28 pm by Jason Byrnes | 212 views | 4 replies |

Christopher WestCommunity Expert

deleting cart session on page load

Just a quickie...

On my success page. it will send out customer order confirmation and add order to the database on page load. What is the correct session to delete the whole of the ecart session. and I am assuming it would be placed at the bottom of the page? (note: the success page will display a little message to the customer using their name, email, and order number which are displayed on the screen vis sessions) So I would need to delete the ecart session AFTER this information is displayed. I have tried before but it didn't work out as I planned.

Chris

Sign in to reply to this post

Jason ByrnesWebAssist

use the clear cart behavior, with the before page load trigger and move the code block to the end of the page.

Sign in to reply to this post

Christopher WestCommunity Expert

Hmm you mean this block of code:

php:
<?php

// WA eCart Trigger Clear Cart
if ("" == "")     {
  
$DinkyCart->ClearCart();
  
$Redirect_redirStr="";
  if (
$Redirect_redirStr != "")     {
    
$DinkyCart->redirStr $Redirect_redirStr;
  }
  
$DinkyCart->cartAction "ClearCart";
}
?>



I placed it just before the closing HTML tag and the cart contents are still live.

Heres my success page attached.

Attached Files
offline-success.php
Sign in to reply to this post

Christopher WestCommunity Expert

looks like I got it working, it was my code order and on one of my record update server behaviours I had it redirecting on update...so it would NEVER get to the bottom of the page. and then instead I put the redirect in the ecart ISEMPTY code snippet like follows:

<?php
// WA eCart Trigger Clear Cart
if ("" == "") {
$DinkyCart->ClearCart();
$Redirect_redirStr="";
if ($Redirect_redirStr != "") {
$DinkyCart->redirStr = $Redirect_redirStr;
}
$DinkyCart->cartAction = "ClearCart";
}
?>
<?php
if ($DinkyCart->IsEmpty()) {
$DinkyCart->redirStr = "account.php?Access=order-processing";
$DinkyCart->cartAction = "RedirectIfEmpty";
}
?>
Attached Files
offline-success.php
Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear you have it woking.

Sign in to reply to this post

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