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

retaining form values in checkout

Thread began 4/20/2009 4:24 pm by russell_m89943 | Last modified 3/15/2012 8:32 am by toni272059 | 2790 views | 16 replies |

russell_m89943

retaining form values in checkout

I was wondering if there was a way to retain form field values when a user goes back to edit information before making an order. My purchase looks like this:

1. checkout form (credit card info, bill address, etc)
2. review information
3. Submit order

If the user finds something they need to change in step 2 I'd like to be able to go back to step 1 but with the form already filled in with the previous information. I tried adding something like this to the value field: <?php echo $_SESSION['eCartCheckoutForm_cc_number']; ?> but it's showing up blank with an empty value when I view source.

Actually, on the same topic I think, is it possible to have the purchase information show up in the success page so they can print their order info for their records? I can't seem to find any session info in my success page.

Sign in to reply to this post

Ray BorduinWebAssist

The values should be stored as session variables, I think if you set the field value to the session it should work. If you refresh the page does it then fill in?

It might be because it uses a history.back() to navigate back?

Sign in to reply to this post

russell_m89943

Didn't work, I've tried adding values from both the "session" bindings list and the "ecart_checkout_form" bindings but both are giving me blank forms, even on refresh.

Test case for session:
<input type="text" name="cc_number" id="cc_number" value="<?php echo $_SESSION['eCartCheckoutForm_cc_number']; ?>" />

Test case for checkout form:
<input type="text" name="firstname" id="firstname" value="<?php echo((isset($_POST["firstname"]))?$_POST["firstname"]:"") ?>" />

If I were using the checkout wizard would these values stick they I'm trying to get them to work?

Sign in to reply to this post

Ray BorduinWebAssist

Do you have:
<?php session_start(); ?>

on top of the page?

Sign in to reply to this post

russell_m89943

I added it but that didn't seem to do the trick. Here's all the PHP I have at the top right now:

<?php session_start(); ?>

<?php
//WA eCart Include
require_once("../WA_eCart/bellaCart_PHP.php");
?>
<?php
$bellaCart->GetContent();
?>
<?php
require_once("../WA_eCart/PP_ECO_Scripts/PP_ECO_PHP.php");
?>
<?php
require_once("../WA_eCart/Adv_CO_Scripts/PP_DirectPayment_PHP.php");
?>

Should I make sure that session command is in all the checkout pages?

Sign in to reply to this post

Ray BorduinWebAssist

actually if you have a session based cart on the page it already has the session started. I just can't figure out why it wouldn't be populating the fields from the session. Are you sure you are using the correct session variable names?

Sign in to reply to this post

russell_m89943

Pretty sure I'm grabbing the right variables, I'm just dragging them from the session bindings menu into the code (see attached for a partial list of the elements I'm using)

For the review page I'm actually populating the review text with the ecart_checkout_form variables, when I try to use the session variables there nothing shows up either. It would seem that the session is there in the binding but it's not populating at any point. I also checked my other eCart enabled pages and they all feature the same session bindings indicated in the attached image file. Maybe there's some sort of disconnect between the bindings and my code because I haven't been using the wizard?

Sign in to reply to this post

Ray BorduinWebAssist

Yes, if you run the wizard once on your site, it always thinks the session variables are set even if you deleted those pages and start over. I would say you probably have to set the session variables on the confirm page so that you can use them to populate the checkout page when they go back.

Sign in to reply to this post

russell_m89943

That makes sense, here comes the dumb question: how would I set those session variables? And would those vars be available to me after I've completed the transaction with my payment gateway so I can present the user with a proper receipt? (I assume yes on the 2nd point but figured I'd ask anyway)

I also know I've said this before but I really appreciate the help, you're saving me hours on a project I underbid on in the first place. New lesson learned, don't give friends a professional discount ;-)

Sign in to reply to this post

Ray BorduinWebAssist

On your confirm page, go to bindings and add the Form from the checkout page.

Then use the server behavior in the Ecart General Category to save the session variables. You will have to apply it once for each field you want stored. Just use the current session variable names since they aren't being used.

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