close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to unset eCart Variables

Thread begun 3/31/2009 1:41 pm by johnlanglois | Last modified 4/06/2009 2:32 pm by neileisen207079 | 4332 views | 8 replies |

johnlanglois

How to unset eCart Variables

I hate to have to ask this again, but the answer in the old forum could not be found.

Upon return from PayPal, I want to clear the eCart so that the user can't hit the back key, change the order and submit it again.

Eric had a nice "how to clean it up" post in the old forum, but I can't find it.

I do not want to have a wholesale session destruction, because that would entail logging the client back in.

What functions should I call to empty the cart?

Thanks.

Sign in to reply to this post

Ray BorduinWebAssist

What server language?... this question has been answered several times on the new forum for php. Have you searched this forum?

Sign in to reply to this post
Did this help? Tips are appreciated...

johnlanglois

How to unset eCart

PHP.

I searched the forum, but only found one oblique reference to the idea.

Point me to a good list and I will be appreciative.

Sign in to reply to this post

Ray BorduinWebAssist

showthread.php?t=271&highlight=clearcart

would do the trick. I end up recommending:

$cartName->ClearCart();
unset($_SESSION['OrderID']);

Sign in to reply to this post
Did this help? Tips are appreciated...

neileisen207079

Where is this placed

Ray,
I got this to work, but when I put it in the top of the checkout success page - the receipt ends up being empty because it says the cart is empty. So its working, but it has to come after that page somehow. How is that normally handled?

thanks. I really need the help!

Sign in to reply to this post

Ray BorduinWebAssist

Put it at the bottom of the page instead.

Sign in to reply to this post
Did this help? Tips are appreciated...

neileisen207079

I screwed up.

That seems to work, but I changed something else and I cant figure out what I did. The same OrderID is being rewritten each time, and now there is a NULL value in the OrderReferenceID and OrderTotal. Those fields were working before I started screwing around. I think I deleted the session variable for OrderID but I added it back in manually. Aghhh.

I am using Paypal if that matters and the orders are going through... it just isnt adding a new ORder to the Orders table... it is updating the same one, and as I said, setting those 2 fields to NULL.

Sign in to reply to this post

neileisen207079

All messed up OrderReferenceID and OrderTotal

I added this to the bottom of the checkout Success page and now it IS creating a new entry in the orders table each time:

<?php
$eCart1->ClearCart();
unset($_SESSION['OrderID']);
unset($_SESSION['eCart1_OrderID']);
?>

Now the only problem still seems to be something I did that causes the OrderTotal and OrderReferenceID to be NULL.

The previous orders had an OrderReferenceID that looks something like this:

ot3s52cegprk0793f5epd80of5

Any ideas Ray? Thanks in advance.

Sign in to reply to this post

neileisen207079

Figured it out

OK, My local copy of the Database didnt have those two fields, so the reference to them was removed in the add order to database behavior. I added those fields and mapped the Session ID and Grand Total and now it works. thanks for answering my other questions. Maybe this will help someone else, although I doubt anyone could duplicate such a stupid mistake.

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