close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart not empty after Checkout and Confirmation Email

Thread began 12/27/2012 2:32 pm by fms77717 | Last modified 6/25/2013 2:55 pm by Jason Byrnes | 668 views | 7 replies |

fms77717Beta Tester

eCart not empty after Checkout and Confirmation Email

I have a problem with eCart5 not clearning the Shopping Cart after checkout.

I placed the following code at the end of the checkout_success.php file and the cart does not empty at all. This creates a problem with customer registering again for the same event and we have to provide a refund.

Just before the footing on the final page I have the following code:

// Clear the Shopping Cart
$eCart4->ClearCart();

However, the items in the cart remain.

Thanks.

Sam

Sign in to reply to this post

Ray BorduinWebAssist

Can you a attach a copy of the final page so I can take a look at it. I might be able to spot the issue that way.

Sign in to reply to this post

fms77717Beta Tester

Attached is the file. I just lived with it for awhile as I had other projects to attend to.

The clear cart is 6 lines from the bottom of the code.

Attached Files
checkout_success.php
Sign in to reply to this post

Jason ByrnesWebAssist

the code looks like it should clear the cart.

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

fms77717Beta Tester

Clearing the Cart after checkout.

Jason,

See the private message.

Sign in to reply to this post

Jason ByrnesWebAssist

the cart is stored in a session, you could destroy the browsing sesion using the following code after the closing </html> tag:

php:
<?php

// Initialize the session.
// If you are using session_name("something"), don't forget it now!
@session_start();

// 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 (ini_get("session.use_cookies")) {
    
$params session_get_cookie_params();
    @
setcookie(session_name(), ''time() - 42000,
        
$params["path"], $params["domain"],
        
$params["secure"], $params["httponly"]
    );
}

// Finally, destroy the session.
@session_destroy();
@
session_regenerate_id();
?>
Sign in to reply to this post

fms77717Beta Tester

Clearing the Cart after checkout.

Jason,

Since the Clear Cart is not working as it should, wouldn't it be simpler to just loop through the cart items and delete each item?

I can check on how the Shopping Cart does it with the delete check box and the $eCart4->UpdateCart();

I just need to know which eCart session item the UpdateCart is looking for to delete this particular item.

$eCart4->MoveFirst();
for ($n=0; $n<sizeof($eCart4->Items); $n++)
{
$this->DeleteFromCart($n, false);
$this->ReIndexContent();
$this->ResetAll();
$this->SaveCart();
}

I'm not certain of the code, but wanted to give you my simplistic thoughts on this.

Sign in to reply to this post

Jason ByrnesWebAssist

the simplest way to clear the cart after checkout is to destroy the session using the code provided in my last reply.

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