close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

problem with store cart details and summary

Thread began 12/15/2009 12:31 am by QuiruNet | Last modified 3/17/2010 10:34 am by Jason Byrnes | 3638 views | 13 replies |

QuiruNet

problem with store cart details and summary

The problem is that the user buy the products, its save the operation that the use Bought, but if the user want to buy again, without close the explorer or firefox, the second time, this next operation rewrite the firts one.

I don´t how to make work that, i want to save every operation the user do, doesn´t matter how many time he buy.

If the user close de explorer and open again its work...

Sign in to reply to this post

Jason ByrnesWebAssist

Add the following code to the Checkout Success page, after the </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();
?>
Sign in to reply to this post

QuiruNet

codoe return

This post has been deleted.

QuiruNet

it doesn´t work

i puted de code in /html:
<?php
mysql_free_result($rsSeo);

mysql_free_result($rsNovedades);

mysql_free_result($rsUsuario);
?>
<?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();
?>

--- in de two tables the wrotte the same OrderReferenceID, but the order sumari the do well the same the two actions, but with the samen OrderReferenceID. BUT the table orders details, the do the same thing they rewrite the order with the second action.

MAY BE a have te wriete someelse in the code you told me befere..some session?, for the OrderReferenceID i use the ecartd: <?php echo session_id(); ?>, that that writte a long OrderReferenceID, for example:831607a670e5605028633c5cf9eda349

In the order sumary is working fine, still put the same OrderReferenceID, but do not rewrite the information, but in te order detail still rewrite de order detail if the user buy for second time witout close the explorer.

THANKS

Sign in to reply to this post

Jason ByrnesWebAssist

Are you getting to the checkout success page? it will only change the outcome if you are actually getting to the checkout success page.

Sign in to reply to this post

QuiruNet

the final step

the thing is the same user, forget to buy something...and he is buying and make a second order, the second order kill the first order in the order details table, but in the sumary order tamble save de operation without killing de firts one. Do you know why?

Sign in to reply to this post

Jason ByrnesWebAssist

This problem occurs if an order is placed with out a new session occurring.

The session destroy code I sent should cause a new session to start.

On what page did you add the session destroy code?

It should be on the page that the customer is brought to after completing the order, before they can start a new one.

Sign in to reply to this post

QuiruNet

i did how you told me

i put the code the page the user is finish the checkout, but the code kill all sesions less de sessio ID for the ordersummary, that still the same...and the user try to buy again the second order he buys kill the first order details table. I don´t know why still make that...i copy and paste just like that :

<?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();
?>

I have to put something else?.....

Sign in to reply to this post

Jason ByrnesWebAssist

Try adding this code at the bottom as well:

php:
<?php
session_start
();
unset(
$_SESSION);
session_regenerate_id(TRUE);
session_start();
?>
Sign in to reply to this post

QuiruNet

Error

Parse error: syntax error, unexpected T_UNSET in C:\Inetpub\vhosts\actualitysantiago.com\httpdocs\v09\cart_confirmar_pedido.php on line 457

LINE 457 unset($_SESSION);

I WROTE LIKE THIS:
<?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();
?>
<?php
session_start()
unset($_SESSION);
session_regenerate_id(TRUE);
session_start();
?>

Sign in to reply to this post
loading

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