Skip Navigation

[Resolved] Woocommerce Fields in User Form

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

Problem:

The issue here is that the user wanted to populate the Woocommerce user profile fields using our Toolset Forms plugin.

Solution:

This will only work for simple text fields that Woocommerce provide, So Checkbox fields wont work.

So what you need to do is to edit your form in expert mode and add the generic field.

<div class="form-group">
<label>Shipping Phone Number</label>
[cred_generic_field type='textfield' field='shipping_phone']
{
"required":0,
"persist": 1,
"default":""
}
[/cred_generic_field]
</div>



The example above is for the Phone field that woocommerce provides.

This support ticket is created 5 years, 7 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by shawnW-3 5 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1243793

Tell us what you are trying to do?
I want to integrate the Woocommerce Billing and Shipping address fields into a custom Toolset User Form, so that the customer can fill out both Billing and Shipping for Woocommerce when registering using the custom form.

Is there any documentation that you are following?
I have been unable to find anything covering this issue specifically. - https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-registering-users/

#1243800

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Shawn,

You can just respond here once your testing is completed.

Thanks,
Shane

#1243827

I must have done something wrong as none of the generic fields passed through. They all showed up on the front end form, and I was able to submit the User Form with no issues, but on the backend only the core fields showed up.

Here's the form code in Expert Mode...

[creduserform]
[cred_field field='form_messages' class='alert alert-warning']
<div class="form-group">
<label>Username</label>
[cred_field field='user_login' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label>Password</label>
[cred_field field='user_pass' class='form-control' output='bootstrap']
[cred_field field='user_pass2' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label>Email</label>
[cred_field field='user_email' class='form-control' output='bootstrap']
</div>

<div class="form-group">
<label>Billing First Name</label>
[cred_generic_field type='textfield' field='billing_first_name']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Billing Last Name</label>
[cred_generic_field type='textfield' field='billing_last_name']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Billing Company</label>
[cred_generic_field type='textfield' field='billing_company']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Billing Address</label>
[cred_generic_field type='textfield' field='billing_address_1']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Apartment, Suite, Unit, Etc.</label>
[cred_generic_field type='textfield' field='billing_address_2']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Billing State Code</label>
[cred_generic_field type='textfield' field='billing_state']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Billing Zip Code</label>
[cred_generic_field type='textfield' field='billing_postcode']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Billing Phone Number</label>
[cred_generic_field type='textfield' field='billing_phone']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Email Address for Billing</label>
[cred_generic_field type='textfield' field='billing_email']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>
<div class="form-group">
<label>Shipping First Name</label>
[cred_generic_field type='textfield' field='shipping_first_name']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Shipping Last Name</label>
[cred_generic_field type='textfield' field='shipping_last_name']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Shipping Company</label>
[cred_generic_field type='textfield' field='shipping_company']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Shipping Address</label>
[cred_generic_field type='textfield' field='shipping_address_1']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Apartment, Suite, Unit, Etc.</label>
[cred_generic_field type='textfield' field='shipping_address_2']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Shipping State Code</label>
[cred_generic_field type='textfield' field='shipping_state']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Shipping Zip Code</label>
[cred_generic_field type='textfield' field='shipping_postcode']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Shipping Phone Number</label>
[cred_generic_field type='textfield' field='shipping_phone']
{
"required":0,
"default":""
}
[/cred_generic_field]
</div>

<div class="form-group">
<label>Nickname</label>
[cred_field field='nickname' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label>First name</label>
[cred_field field='first_name' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label>Last name</label>
[cred_field field='last_name' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label>Biographical info</label>
[cred_field field='description' class='form-control' output='bootstrap']
</div>
[cred_field field='recaptcha' class='form-control' output='bootstrap']
[cred_field field='form_submit' output='bootstrap' value='Submit' class='btn btn-primary btn-lg']
[/creduserform]

#1243842

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Shawn,

Try adding, persist: 1;

Example
<div class="form-group">
<label>Shipping Phone Number</label>
[cred_generic_field type='textfield' field='shipping_phone']
{
"required":0,
"persist": 1,
"default":""
}
[/cred_generic_field]
</div>

This tells the field to store to the database.

Thanks,
Shane

#1243856

THIS DID THE TRICK!

#1243857

My issue is resolved now. Thank you!