4

I wish to pre-populate my billing and shipping details for logged in members

VALUE="{exp:member:custom_profile_data}{firstName}{/exp:member:custom_profile_data}"

This correctly populates the form fields however when I submit the form when there is an error on the form such as a required field not being complete all the form fields are reset to blank.

So I basically need something along the lines of the following:

if inline error then use

VALUE="{firstName}"

otherwise use the following:

VALUE="{exp:member:custom_profile_data}{firstName}{/exp:member:custom_profile_data}"

Is this possible? If so anyone care to share the syntax?

Thanks

1 Answer 1

3

If you map the form fields by going to Store > Settings > Order Fields and map each of the order fields to your respected member profile fields as seen in the screenshot: Order Fields

You can then use:

{field:first_name}

or

{field:billing_state}

to have the value populated automatically on return visits for that member but also will persist through page loads.

EDIT:

As Adrian mention in the comments you need to empty your cart anytime you make changes to your member data as it is only loaded once.

2
  • Note that you need to empty your cart between each test for this to work. The mapped member fields are only loaded once per cart. Commented Dec 3, 2013 at 21:19
  • Great point, I have edited the answer to include that. Commented Dec 3, 2013 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.