Tags/topics: 
1
Answers
Vote up!
0
Vote down!

How may I allow registered users to complete the order in a usable way? (removien fields that I don´t need them to complete... again)

Hi there,
I have this problem with a commerce site:
I´ve configured it for this workflow:

a. Anon user completes an order. The order contains profile2 fields.
If the payment gets confirmed the user is created, his profile2 fields are filled with the order information, and he gains a role in the site.
Registered user has to do the same.

b. The problem is that the registered user already has fulfilled his profile2 already, and it´s tiresome to do it again.

How may I allow registered users to complete an order in a more easier way?

Thanks!

Asked by: Rosamunda
on April 29, 2013

Comments

Any ideas?
I´ve posted at the drupal forum in the past, but they told me that I should post issues here instead of there.
But there are even less users here I think...

- Rosamunda on May 1, 2013

1 Answer

Vote up!
2
Vote down!

You would need to run a hook_form_alter() to change the default values of a form that hasn't been submitted yet...

http://websmiths.co/blog/very-introduction-drupals-hookformalter

That's a nice tutorial on how to get something up and running.

To pull a user's info, you would just need to do the following:

<?php
function something() {
  global
$user;
 
dpm($user); // requires devel module to see into array.
}
?>
Josh Miller
Answer by: Josh Miller
Posted: May 3, 2013