In Ubercart, there was a module called "UC Profile" (http://drupal.org/project/uc_profile), that created another checkout pane that let a user fill in a new user profile, or edit their current user profile. I've been hunting for about an hour now trying to find a similar method for doing this in Drupal Commerce.
We want to collect this information, as we sell memberships on our site, and in the future we may want to mail out a membership card and other info. I know I can do this in a "shipping information" pane, but we also want to be able to know where all our users are living. This data might also differ from their billing and shipping information, hence why we want them to fill out a "user profile" on checkout.
Any thoughts?
Comments
Comment #1
rszrama commentedYou can do this several ways... one would be to write a module that exposes profile data to the checkout form like we did with Ubercart. Another would be to use a new customer profile type instead of the core profile. A third would maybe be used in combination with any of these - with Rules, you could extract values for these fields from the submitted order and store them in the profile. You could probably do this with a ready made solution using http://drupal.org/project/commerce_fieldgroup_panes and adding fields to the Order that could be migrated to the profile on checkout completion. However it works out, once you post or document a solution, we can move this to fixed. I'll leave it postponed for now.
Comment #2
acrazyanimal commentedI also need this sort of functionality. I tried adding a new customer profile and rules combo method. However there doesn't seem to be a way to access the customer profile info related to an order through rules. I created another issue for this: http://drupal.org/node/1346364
Comment #3
tscadfx commentedHere's how you would accomplish this.
1- In admin/config/people/accounts/fields add a postal address / dynamic address form and any additional fields that you would want to use in the "profile". For the sake of this example I used Personal Information (field_profile_info)(for the postal address) and Phone Number (field_phone) as a text field.
2- Remember that per Draupal Commerce FAQ (http://www.drupalcommerce.org/faq/account-creation-required-fields) the only fields that will appear will be the ones marked as required.
3- Add any additional fields (beside the address field)(so in my case the phone) to admin/commerce/customer-profiles/types/billing/fields
4- With rules modify the rule "Create a new account for an anonymous order"
5- Add a condition = Entity has field / Entity = commerce-order:commerce-customer-billing / Field = commerce_customer_address
6- Add a condition = Entity has field / Entity = commerce-order:commerce-customer-billing / Field = field_payment_phone
7- Edit the element "Create a new entity" and you should now see (in my example) Personal Information and Phone Number
8- Personal Information data selector = commerce-order:commerce-customer-billing:commerce-customer-address
9- Phone Number data selector = commerce-order:commerce-customer-billing:field-payment-phone
Save and your information from checkout will now be transferred into the user "profile" (fields).
Here's the rule as I used it:
Comment #4
pcambraMaybe we should be able to expose fields from any entity into checkout in commerce fieldgroup panes. What do you think?
Comment #5
trevorkjorlien commentedThanks, tscadfx. I'm still debating whether this is the best option or not.
My next concern would then be, if a user comes back to order something else, would there be a way to "pre-load" the data in the fields that they've already inputted for their user profile? Or would the fields be empty again?
To me, that seems cumbersome, and a bad user experience (especially if they bought one thing, then a few minutes later decide that they want to buy something else, and see the fields that they *just* typed in are empty already).
Comment #6
tscadfx commentedtrevorkjorlien,
There is a way for this via this module: http://drupal.org/project/commerce_addressbook ... well kind of.
The module is still under heavy development and in my experience with it, it will only work with the dynamic address fields and nothing else. Any custom fields will result in an error as the module doesn't know how to store any other information, nor ignore it for that matter. Additionally, the aforementioned module only deals with the database containing the commerce billing information and not the user profile fields, which it will most likely never support.
There might be a way via rules to import the user fields into the checkout but this would be frowned upon in many cases because the user field information would not always be the billing information.
Also note that my example (post #3) does not update the information once the user has an account. It only transfers the information upon account creation/checkout and the fields are completely separate in the database. In other words, the user information is stored once in the commerce database user billing information and copied to the database containing the user profile fields. A rule could be created to compare the two and update them accordingly.
Should you wish to use the commerce addressbook module with custom fields you might be in luck because there is a patch to address this. Unfortunately the person who created the patch did so in a non-standard, so it may have to be manually applied. I'll attempt to get a git patch out for that module tomorrow. Here's the link: http://drupal.org/node/1310072
(edit) I corrected some of the code and made a patch available on the link ^^^^^ right there.
pcambra,
I think that exposing fields from other entities into the checkout would be very helpful.
Comment #7
zambrey commentedHi, @trevorkjorlien you should check Commerce Addressbook module to preload data if the user has already ordered something before.
In my view the best idea to store user profile is achieved in Ubercart Addresses. I mean that this module wasn't perfect when I used it a year ago but I liked the idea of it. So it had list of addresses which could be edited/deleted by user. One of the adresses could be set as default and was preloaded on checkout form.
Then with my custom module I could easily show profile fields on user registration form and store data for later use.
Comment #8
rszrama commented