Checkout Form Field Not Saving Data (and on Page Refresh)

After much searching in the forums, I could not find much as to what is happening now on our store checkout page. If you enter data into the form fields during checkout, and then hit the web browser refresh button (or enter a coupon code or similar refresh action), the field data already entered usually stays intact on the checkout page to continue the transaction. However, we recently had to recreate our theme and now the default e-mail address profile field (on our store it is ID #40) does not want to save into “store_orders” database table “email” column (which is the customer’s main e-mail address). We get an auto-generated fake FirstName-LastName-Timestamp@example.com e-mail address there instead. I also noticed any data entered in the form e-mail field now disappears on the checkout page if you hit the refresh button or similar action during checkout. I created a custom e-mail profile field to use in the meantime until the default e-mail field is fixed so we will at least have an e-mail address to work from on our orders - custom profile fields go to the “store_profile_fields_data” database table though, instead of where we need it in this case.
Any thoughts?
Attached are some screen shots (Before and AFTER a page refresh) - I added both e-mail fields to the checkout form in a test so you could see the difference (labeled “Email” is the custom e-mail field and labeled “E-mail” (with a dash) is the default e-mail field) — I later created another screenshot of the View Source of the checkout page after a page refresh (I also renamed the default e-mail label to “Default E-mail” in that image)… Thanks!!!



UPDATE: I got it figured out if anyone else runs across a similar issue. So there are two places where profile fields come into play on the checkout page: One area to create profiles - Located at: Administration → Profile fields /// The other area is for the use of them on the checkout layout page - Located at: Design → Layouts → Layouts (if you have more than one storefront, you will need to select each one in here) → then you click on the “Checkout” button/tab near the top for that layout. You then need the “Customer information” Block (ours was #260) - Click the little gear for “Block options” in that block (arrow1). Then you click on the “Content” button/tab (arrow2). Then you can add/remove profile fields (arrow3) and configure whether you want them to be required or not, sort them, etc.
So here was the issue in our situation: When we switched from the multi-page checkout to a single page checkout during an upgrade many many moons ago, the original default e-mail field (#32) initially must have stopped working for whatever reason, so a new e-mail profile field was created (#40), and somewhere along the way #40 was somehow set to is_default=Y in the database and everything worked just fine ever since. However, once the theme needed to be re-built recently, something in there that allowed that unique setup to work broke down. Unfortunately the billing e-mail address profile #32 was not an option in the “Add profile fields” for the “Customer information” block to even be added. So, I went into the database table “store_profile_fields” and Edited the “section” column to be a “C” so it would show up as a profile field to be an option to select from. Once I did that, I could re-add the intended original #32 default e-mail address profile field back into the Customer information Checkout Layout. I also needed to set the prior e-mail address profile field #40 (the original “code” for that profile was set to “email” (the exact same as the billing and shipping e-mail codes - and that may have something to do with how it was able to work for so long(?)), but I changed that while troubleshooting things here) that we were somehow using for the “is_default” column to be “N”. After all that, everything works like a champ. Good times… :wink:

3 Likes