close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem with checkout pages and session

Thread began 11/27/2011 4:17 pm by Base5 Designs | Last modified 11/29/2011 4:21 pm by Jason Byrnes | 801 views | 3 replies |

Base5 Designs

Problem with checkout pages and session

I am very nearly complete on the site i am working on.

I have one last problem to sort out that i think is to do with session variables:

A user is required to log-in before checking out.
and is checked against SESSION['UserGroupID']

If a user has logged in, and enters shipping info on the checkout page then clicks the checkout button, when the order summary with shipping discounts etc is displayed FOR THE FIRST TIME all the details are stored into the database as expected, with no problems.

But if they try to add anything else to the order, change shipping details or navigate away from the confirm page.

Next time they arrive the confirm page the following error occurs:
Unknown column '1d2d1c68fb25abbabad113050281dc8c' in 'where clause'

i can only assume this is the session id, whats going on here?

if they continue with the order from the originals steps (ie clicking checkout instead of changing shipping info, adding to the order, navigaing away) everything works ok they get sent to worldpay the transaction is processed all emails are sent out.

but if they try to make another order the above error happens.

i have added the code from the threads about clearing session variables to my success page, but this is not seeming to clear the session id.
maybe because of the way worldpay calls the response page
the code i have on the end of the response page is:
<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
@session_start();
//store the UserID Session Variable
if(isset($_SESSION['UserID']) && $_SESSION['UserID'] != "") {
$UserID = $_SESSION['UserID'];
}
if(isset($_SESSION['UserGroupID']) && $_SESSION['UserGroupID'] != "") {
$UserID = $_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.
session_destroy();
@session_start();
//Reset the UserID Session Variable
if(isset($UserID) && $UserID != "") {
$_SESSION['UserID'] = $UserID;
}
if(isset($UserGroupID) && $UserGroupID != "") {
$_SESSION['UserGroupID'] = $UserGroupID;
}
?>

and thats is not clearing anything from what i can make out, i have checked i am using the correct session names.

Ideally i would prefer that no orders are stored in the database, until the submit order button is pressed.
but the form on the confirm page submits directly to worlpay, if i set the add summary and detail behaviours to execute on submit_buttonname pressed the details dont get added.

i am assumming that if i set the form to submit to itself then my insert summary and details will work. but the redirect on the add cart details to daabase behaviour wont post the formdata to worldpay via post... as it would use get....

so what do i need to do to get all this working??

would appreciate a quick response as the site needs to be live for the 1st december.

have attached my files for you look at

Attached Files
ecart not adding order details.zip
Sign in to reply to this post

Jason ByrnesWebAssist

this looks like a problem with the way you have set up the Store Cart Summary behaivor.


In the Store Cart Summary behavior, you have set the ID column to be the OrderCartID and bound that column to the session ID.

The ID column in the Store Cart Summary behavior should be the Primary key Column for the orders table. The primary Key column should be set to Auto Increment , you should be assigning a value to it in the Store Order Summary behavior.

When the order summary stores the order, it will save the auto increment value to a session that is used in the store order details behavior. In the store order details behavior, the ID column you choose is not the primary key column, it is a column used to create a relationship between the order and the order details record.

you have the Store Order Details behavior set correctly, but the store order summary

Sign in to reply to this post

Base5 Designs

Hi thanks for your reply Jason.

I knew it was going to be something simple, thanks for spotting what my tired eyes couldn't.

I am always very impressed with your support, even if i do sometimes find the extensions a little bit clunky.

Am slowly getting the hang of the ecart, and am very impressed.

One thing i would like to ask is, if there is a tutorial somwhere for being able to manage rules, via a content managment system.

at present, them being hard coded, works well but does not allow my client to easily add new discounts.
they have to call me and then i have to modify the cart to allow the new discounts.

Sign in to reply to this post

Jason ByrnesWebAssist

this post has details on setting up a dynamic coupon system. this should give you a good place to start;
showpost.php?p=23007&postcount=2

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