1
Answers
Vote up!
0
Vote down!

Using tokens in checkout pane fields to populate defaults from Profile2 profile field

I have main and secondary user profile types created with Profile2

I want to create an order fieldset in commerce containing fields from the secondary user profile data.

I can create the order fieldset fields and assign the fieldset as a checkout pane. This allows the info captured during checkout to be asigned to an order. however I cannot seem to be able to use tokens to set default values.

I have tried 'field default token' module to assign tokens to the coresponding fieldset fields but this does not seem to work.

Possibly I am picking the wrong token of this module is not compatible

Does token and 'field default token' work with Commerce and more specifically does it work with checkout / order fieldsets?

Any help would be muchg appreciated.

Asked by: Andrew Fickling
on October 2, 2014

1 Answer

Vote up!
1
Vote down!

Andrew,

This could be tricky, since you're copying data from one source and potentially not updating the source if that changes.

For this to work you to need to use Rules. You will need to create a rule that "Sets a Data Value" for orders based on the user's profile 2 fields. To get the user's profile 2 fields, you would need to run what's known as a "fetch entity by property" action and then loop over the results and "Set a Data Value" for the Order from within the loop.

Josh Miller
Answer by: Josh Miller
Posted: Oct 3, 2014