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

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.

| improve this answer | |
  • 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. – Adrian Macneil Dec 3 '13 at 21:19
  • Great point, I have edited the answer to include that. – Justin Long Dec 3 '13 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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