2 Replies Latest reply: Nov 21, 2013 8:28 AM by AnneGerber RSS

    Carrying over address info from new account created on checkout page

    AnneGerber Community Member

      Mario has written a great document on "Creating login functionality on eCommerce registration form for return customers"

       

      http://forums.adobe.com/docs/DOC-2529

       

      I used this to put a username/password at the bottom of the form for new customers to create an account. I have a question, though, is there any way to push the address info entered by the new customer into the checkout page into this new account?

       

      Thanks!

       

      Anne

        • 1. Re: Carrying over address info from new account created on checkout page
          AnneGerber Community Member

          I wanted to update this since I figured out the fix:

           

          The fields located within the checkout page - e.g. BillingAddress, BillingCity, etc. -- do not correspond to the fields within the user's account details -- e.g. HomeAddress, HomeState, etc.

           

          What you need to do is create hidden fields within your checkout page which will be used to capture the billing address details from the checkout form and then copy them over to the user's newly created account.

           

          Here is your Username/Pass fields:

                          <label for="Username">Email Address or Create Unique Username</label>

                          <input type="text" name="Username" id="Username" class="cat_textbox" maxlength="255" />

                          <label for="Password">Password</label>

                          <input type="password" name="Password" id="Password" class="cat_textbox" maxlength="255" autocomplete="off" />

                           <label for="PasswordConfirm">Confirm Password</label>

                          <input type="password" name="PasswordConfirm" id="PasswordConfirm" class="cat_textbox" maxlength="255" autocomplete="off" />

           

          Here are your hidden fields:

                          <div style="display: none;">

                          <label for="HomeAddress">Home Address</label>

                          <input type="text" name="HomeAddress" id="HomeAddress" class="cat_textbox" maxlength="500" />

                          <label for="HomeCity">City</label>

                          <input type="text" name="HomeCity" id="HomeCity" class="cat_textbox" maxlength="255" />

                          <label for="HomeState">State</label>

                          <input type="text" name="HomeState" id="HomeState"  class="cat_textbox" maxlength="255" />

                          <label for="HomeZip">Zipcode/Postcode</label>

                          <input type="text" name="HomeZip" id="HomeZip" class="cat_textbox" maxlength="255" /></div>

           

          You'll need to implement some scripting to do the copying for you. But first you need an action to start the process. I put a checkbox under the password and username fields "Create an account for me" - The user checks it, the fields get copied and then the info is pushed to the user's account.

           

          Since I'm no js coder: I used Mario's extremely helpful post on "Setting the billing address to be the same as the shipping address" as a guide to creating the code. Shout out, Mario! http://forums.adobe.com/docs/DOC-2814

           

          Put this underneath your username/password fields:

          <input type="checkbox" onclick="CopyAddress(this.checked);" /> Create an account for me, please

           

          Then add your script at the bottom of the form.

           

          <script type="text/javascript">

          function CopyAddress(checked) {

                    if (checked) {

                              document.getElementById('HomeAddress').value = document.getElementById('BillingAddress').value;

                              document.getElementById('HomeCity').value = document.getElementById('BillingCity').value;

                              document.getElementById('HomeState').value = document.getElementById('BillingState').value;

                              document.getElementById('HomeZip').value = document.getElementById('BillingZip').value;

                    }

          }

          </script>

           

          Be sure to add these fields into your webform -- Site Manager-->Webforms -- before you start to customize. Just copying and pasting code into existing webforms does not work. And don't make the username and password fields manadatory. It might result in an abandoned cart for those that just want to check out as a guest.

           

          I hope this is useful to someone out there. It has worked great for me!

          • 2. Re: Carrying over address info from new account created on checkout page
            AnneGerber Community Member

            UPDATE: Because every order generates a new customer, this method will send an autoresponder email even to folks that just checkout as a guest. You will have to disable the autoresponder email for Member Only Details. This will NOT disable the autoresponder invoice, just the email giving the customer a summary of their account details.

             

            Add this to the <form> code:

            action="/FormProcessv2.aspx?.....&SAR=False"

             

            You can find more info here: http://forums.adobe.com/docs/DOC-2363