The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Pre-Populate Email, but do not Checkout without password

bilsonbilson Member
in General edited August 2009
Hello:
I am using Unified Order Entry to allow admins of a password-protected system to setup subscriptions and make one-time payments on behalf of users. Currently, I have an admin page that starts by choosing a user. The subscription details are chosen and the user's email is displayed. It is noted that this email must be entered on the checkout page along with the UOE password. I would like to make this process slightly more efficient by automatically pre-populating the chosen user's email address upon checkout. However, in doing so, the checkout automatically flips into "Checkout without Password mode". I need it to stay in password mode in order to enter the UOE password. I suppose it would also be nice if I could pre-populate the UOE, but it is probably safer to just have them remember that. Sorry if I am missing something simple here.

Best Regards,

David Baldwin
Comments
  • brettbrett FoxyCart Team
    edited August 2009
    Hi David.
    Yeah, what you're describing makes sense, but I wouldn't recommend how you're doing it, partly because pre-populating does indeed flip the customer record to a sort of fake "guest checkout", so if you're doing subscriptions... things might get interesting.

    That said, what we'd recommend would be to explore the integration possibilities using SSO and the User API:
    http://wiki.foxycart.com/docs:single_sign_on
    http://wiki.foxycart.com/docs:api

    So:
    - If you know the customer info already, send it to FoxyCart using the API. On UOE checkout, it will work as expected.
    - If you don't know the customer info already, do a normal (non-prepopulated) checkout and create the user in your system automatically on receipt of the XML datafeed.

    Does that help?

    EDIT: Probably less the SSO and more the API. Sorry if that's confusing.

    EDIT AGAIN: Luke has pointed out that I'm not making any sense. See my next post.
  • brettbrett FoxyCart Team
    Ok, so Luke and I are confused on what exactly you're doing here, but we think that if you just want to avoid the re-typing or copy/pasting of the email address, you could pass in the email address as a hidden field (h:), which will get it into the JSON.

    Then on the checkout you just do a quick bit of javascript to:
    - See if the h:customer_email value exists. If so, stick it in the email field and...
    - Click on the "continue". (Simulate the click with jQuery, or check the wiki for the appropriate event to fire.)

    I think that might be what you're looking for?
  • I didnt ask the question of course. But have wondered the same thing. That's a beautiful way to handle that. Thanks brett.
  • bilsonbilson Member
    edited September 2009
    Thanks guys. I guess I forgot to subscribe to this topic and hadn't followed up on my post until now. Your second suggestion was perfect! Here is what I have in my checkout template...
          <script type='text/javascript'>
            //<![CDATA[
              jQuery(function($){
                if(fc_json.custom_fields.customer_email){
                  $('#customer_email').val(fc_json.custom_fields.customer_email);
                  FC.checkout.checkLogin();
                }      
              });
            //]]>
          </script>
    

    Best Regards,
    David Baldwin
  • brettbrett FoxyCart Team
    Thanks for sharing, David.
    I've added it to our wiki:
    http://wiki.foxycart.com/docs:advanced:forum
Sign In or Register to comment.