close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Resetting cart after worldpay transaction - VERY URGENT NOW

Thread began 11/29/2011 2:47 pm by Base5 Designs | Last modified 11/29/2011 9:35 pm by Base5 Designs | 1317 views | 2 replies

Base5 Designs

Resetting cart after worldpay transaction - VERY URGENT NOW

Hi there

I keep mentioning this issue, with my other post's but it keeps geting ignored so here it is on its own.

After a sucsessfull worldpay transaction my response page is showing all the correct information, but my session values ARE NOT GETTING CLEARED.

So the cart remians full, and they have to clear the cart manually.

i've looked on the forums for solutions to clearing the data afer a succsessfull transaction and am implementing the following code:

//WA eCart Include
require_once($_SERVER['DOCUMENT_ROOT'] . "/WA_eCart/eCart1_PHP.php");
// Initialize the session.
// If you are using session_name("something"), don't forget it now!

//store the UserID Session Variable
if(isset($_SESSION['UserID']) && $_SESSION['UserID'] != "") {
$UserID = $_SESSION['UserID'];
if(isset($_SESSION['UserGroupID']) && $_SESSION['UserGroupID'] != "") {
$UserGroupID = $_SESSION['UserGroupID'];
// Unset all of the session variables.
$_SESSION = array();

// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($_COOKIE[session_name()])) {
@setcookie(session_name(), '', time()-42000, '/');

// Finally, destroy the session.
//Reset the UserID Session Variable
if(isset($UserID) && $UserID != "") {
$_SESSION['UserID'] = $UserID;
if(isset($UserGroupID) && $UserGroupID != "") {
$_SESSION['UserGroupID'] = $UserGroupID;

his code is not working as expected...

The cart is not empty, when a user clears the cart manually and makes a new order, the response page and emails are showing the data from the last order, even though the worldpay transaction shows the values for the new order.

I am certain this is because he session_id is stored in the database and so when the new order is made it is not creating a new order reference. because the session~_id is not changing.

I need a fix to this urgently.

I even tried creating a seperate page with the above code and link on my response page to go to this and then have that clear the session, then redirect to my index page and that does not work either.

Please can you provide me with a working solution for clearing the data after a worldpay transaction, preferably keeping the users details in tact.
$_SESSION['UserID'] and $_SESSION['UserGroupID']

I have promised my client the site would be ready to go live on the 1st of december.....

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





Ease of use


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