close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart - checkout page form field persistence after advancing to confirm page - then going back to checkout page

Thread began 10/15/2014 4:03 pm by dlovas275157 | Last modified 10/16/2014 1:19 pm by Jason Byrnes | 398 views | 6 replies |

dlovas275157

eCart - checkout page form field persistence after advancing to confirm page - then going back to checkout page

I built my ecommerce checkout with eCart5

The checkout process is as follows:

cart page (cart/index.php)
checkout page (cart/checkout.php)
confirm page (cart/confirm.php)
checkout success / checkout failure page (cart/checkout_success.php, cart/checkout_failure.php)

Issue - If I have added to cart, filled out the checkout page and proceeded on to the confirm page, but them decide to go back a step to the checkout page, all the form fields in the checkout page need to be re-entered. How do i get them to retain?

Attached are my checkout and confirm pages. I noticed on the confirm page, session values are set from the checkout form post vars, but not sure how to pull them back in. My init values on the checkout page are set to the validated entries currently.

Sign in to reply to this post

Jason ByrnesWebAssist

The information entered on the checkout page is saved to session variables,

use the session variable bindings for the initial value of the form elements to have the information populated on going back to the checkout page.

Sign in to reply to this post

dlovas275157

The init values are currently set to the validated entries so if it fails validation , they remain:

<input type="text" name="firstname" id="firstname" value="<?php echo ((ValidatedField("confirm_386","firstname") != "")?ValidatedField("confirm_386","firstname"):$row_rsUser['firstName']) ?>" style="width:150px" />

Just not sure how to have the init vals set to both validated entry and the session value?

(Tried to post files, but the upload files does not seem to be working. Tried on multiple computers).

Sign in to reply to this post

Jason ByrnesWebAssist

<input type="text" name="firstname" id="firstname" value="<?php echo ((ValidatedField("confirm_386","firstname") != "")?ValidatedField("confirm_386","firstname"):$_SESSION['eCartCheckoutForm_firstname']) ?>" style="width:150px" />

Sign in to reply to this post

dlovas275157

Jason,

Thanks for the quick response. I will give this a try and post back results.

thnx
DL

Sign in to reply to this post

dlovas275157

Jason,

Is there a way to incorporate from my original code :$row_rsUser['firstName'] as the fallback init if BOTH the validated field is empty AND the session var is empty. This occurs when the user comes to the checkout form for the first time after logging in to his/her account.

The rsUser value populates the field if the user is logged into their account and has previously saved their name to his/her profile.

Not sure how to pull all three options in.

Sign in to reply to this post

Jason ByrnesWebAssist

ok, to tie all 3 together, use:

<input type="text" name="firstname" id="firstname" value="<?php echo ((ValidatedField("confirm_386","firstname") != "")?ValidatedField("confirm_386","firstname"):(($_SESSION['eCartCheckoutForm_firstname'] != "")?$_SESSION['eCartCheckoutForm_firstname']:$row_rsUser['firstName'])) ?>" style="width:150px" />
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...