Skip Navigation

[Resolved] User registration in woocommerce

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to use a CRED form to register Users. In that CRED form, I would like to be able to fill in the details for each User's billing information, which will be used by WooCommerce on the checkout page.

Solution: Once at least one User's billing information has been saved, you can instruct Types to manage WooCommerce's billing fields. Go to Types > User Fields and click User Field Control. Select all the fields that begin with "billing_". Then when you generate a new User CRED form, these fields will be included.
State and Country will be displayed as text input fields instead of select fields. You must include the two character abbreviation for State and Country.
If you want to use the data from the First Name and Last Name fields to populate the Billing First Name and Billing Last Name, you can simply hide the billing name fields using CSS. These fields will be automatically populated with the User's first and last names. If you want to modify that information, you can do that in wp-admin or with an Edit User CRED form.

This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#571399

Hello, I made a user registration form. inside there are a lot of information but when I do checkout from woocommerce it ask me to re-enter my information for invoice. Can I put these data in my form and then switch them automatically to woocommerce?

#571526

You can manage WooCommerce fields to some degree with Types and CRED. Billing Country and Billing State will be converted to text fields instead of select fields, so you will be required to know the two-letter abbreviations for all countries and states. I can show you how to find those if you're not sure. The other fields are already simple text inputs, so it's more straightforward to manage those.

Go to Toolset > User Fields and click User Fields Control. Check the box next to all the fields that start with "billing_", then save. This will bring these custom fields under the control of Types. Next, delete everything from your CRED User form and regenerate it. This will add the necessary inputs to your CRED form. When adding or editing a User, you can now fill in their billing information directly in the CRED form.

#571855

Thank you for your assistence.
Now i have WP 4.8.2 and when i search in User Fields Control "billing_" i don't look anythings.
There are problems with this wp version?

thx
a.

#571872

There's no problem I'm aware of with WP 4.8.2, so there must be something else going on.
- Can you confirm you have WooCommerce 3.1.2 installed and active?
- Can you confirm you are logged in as a site admin?
- Can you temporarily disable all plugins except Toolset plugins and WooCommerce 3.1.2, then try again?

Please let me know the results of this test.

#571885

Thank you Christian.
I've tried everything you said to me but nothing. I also installed a new wp with toolset but I no longer find "billing ...".
if you want, I can send you the credentials to enter the website.

a.

#571888

Okay thanks, please send login credentials in the private reply fields here.

#571907

Check the aside site now. I updated my user profile and saved information in the billing fields, and now those fields appear in the User Fields Control page. I guess they don't show up until they have been saved for at least one user. Can you confirm?

#571933

OK, now all is ok.

thank you so much! 🙂

#572037

Good morning Christian,
everything works fine but i have a new question about billing_first_name, i would like it to be equal to first_name without inserting it 2 times. How can I do?

#572163

If you hide these inputs from your form using CSS, WooCommerce will automatically copy the values from first and last name over into the User's billing first and billing last name fields. Here's some example code (note the display none style on each form-group):

	<div class="form-group" style="display: none;">
		<label>billing_first_name</label>
		[cred_field field='billing_first_name' post='user' value='' urlparam='' class='form-control' output='bootstrap']
	</div>

	<div class="form-group" style="display: none;">
		<label>billing_last_name</label>
		[cred_field field='billing_last_name' post='user' value='' urlparam='' class='form-control' output='bootstrap']
	</div>
#572167

Thank you for the reply.
I would like to see billing_first_name with inside first_name so that if there is a need the user can change it.

#572235

You mean, as the user types their first name, it also appears in the billing first name field? That's not something I will be able to help you with, unfortunately, since it requires fairly complex custom JavaScript that responds to user interactions. I can help you show an empty field, or not show the field at all.

#572253

I was hoping there was a way to add two metakey in a user field. This way, I can enter a data and this is copied to two different locations.

#572261

There's not a way to automatically set that up. You would have to use custom code. However, I'm not sure I understand how that is different from what I proposed earlier:
https://toolset.com/forums/topic/user-registration-in-woocommerce/#post-572163

If you hide the billing first name field, the first name will be copied automatically into the billing first name. Am I misunderstanding your request?

#572263

Maybe I'm not understanding your information well.
If I hide the field but want to bill to a different name I can not include this information.
I would like the default name to be equal to the first_name in case of invoice to a different name I can change it. If I hide it I will never change it.