Skip Navigation

[Geschlossen] Woocommerce billing fields show but no info is filled in from user

This support ticket is created vor 1 Monat, 1 Woche. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 1 Antwort, has 2 Stimmen.

Last updated by Nigel vor 1 Monat, 1 Woche.

Author
Artikel
#2689016

I have made an form to edit user info. I want the user to be able to edit also his her billing info. This is the form I have made accordign to this post(https://toolset.com/forums/topic/woocommerce-fields-in-user-form/):

[creduserform]
<div class="container-fluid">
	<div class="row">
      <p class="formtitle"><strong>Persoonlijke gegevens</strong></p>
		<div class="form-group col-md-12">
			<label for="%%FORM_ID%%_user_login">[cred_i18n name='user_login-label']Gebruikersnaam[/cred_i18n]</label>
			[cred_field field='user_login' class='form-control' output='bootstrap']
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-12">
			<label for="%%FORM_ID%%_user_pass">[cred_i18n name='user_pass-label']Wachtwoord[/cred_i18n]</label>
			[cred_field field='user_pass' class='form-control' output='bootstrap']
<label for="%%FORM_ID%%_user_pass2">[cred_i18n name='user_pass2-label']Herhaal wachtwoord[/cred_i18n]</label>[cred_field field='user_pass2' class='form-control' output='bootstrap']
		</div>
	</div>
	<div class="row">
	</div>
	<div class="row">
		<div class="form-group col-md-3">
			<label for="%%FORM_ID%%_geslacht">[cred_i18n name='geslacht-label']Geslacht[/cred_i18n]</label>
			[cred_field field='geslacht' force_type='field' class='form-control' output='bootstrap']
		</div>
		<div class="form-group col-md-3">
			<label for="%%FORM_ID%%_voorletters">[cred_i18n name='voorletters-label']Voorletters[/cred_i18n]</label>
			[cred_field field='voorletters' force_type='field' class='form-control' output='bootstrap']
		</div>
		<div class="form-group col-md-6">
			<label for="%%FORM_ID%%_first_name">[cred_i18n name='first_name-label']First name[/cred_i18n]</label>
			[cred_field field='first_name' class='form-control' output='bootstrap']
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-12">
			<label for="%%FORM_ID%%_last_name">[cred_i18n name='last_name-label']Last name[/cred_i18n]</label>
			[cred_field field='last_name' class='form-control' output='bootstrap']
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-10">
			<label for="%%FORM_ID%%_adres">[cred_i18n name='adres-label']Adres[/cred_i18n]</label>
			[cred_field field='adres' force_type='field' class='form-control' output='bootstrap']
		</div>
		<div class="form-group col-md-2">
			<label for="%%FORM_ID%%_huisnummer">[cred_i18n name='huisnummer-label']Huisnummer[/cred_i18n]</label>
			[cred_field field='huisnummer' force_type='field' class='form-control' output='bootstrap']
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-6">
			<label for="%%FORM_ID%%_postcode">[cred_i18n name='postcode-label']Postcode[/cred_i18n]</label>
			[cred_field field='postcode' force_type='field'  class='form-control' output='bootstrap']
		</div>
		<div class="form-group col-md-6">
			<label for="%%FORM_ID%%_plaats">[cred_i18n name='plaats-label']Plaats[/cred_i18n]</label>
			[cred_field field='plaats' force_type='field' class='form-control' output='bootstrap']
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-6">
			<label for="%%FORM_ID%%_telefoonnummer">[cred_i18n name='telefoonnummer-label']Telefoonnummer[/cred_i18n]</label>
			[cred_field field='telefoonnummer' force_type='field' class='form-control' output='bootstrap']
		</div>
		<div class="form-group col-md-6">
			<label for="%%FORM_ID%%_geboortedatum">[cred_i18n name='geboortedatum-label']Geboortedatum[/cred_i18n]</label>
			[cred_field field='geboortedatum' force_type='field' class='form-control' output='bootstrap']
		</div>
	</div>
	<div class="row">
		<div class="form-group col-md-12">
			<label for="%%FORM_ID%%_beroep">[cred_i18n name='beroep-label']Beroep[/cred_i18n]</label>
			[cred_field field='beroep' force_type='field' class='form-control' output='bootstrap']
		</div>
	</div>
	<div class="row">
      <p class="formtitle"><strong>Voorkeuren</strong></p>
		<div class="form-group col-md-6">
			<label for="%%FORM_ID%%_eventuele-dieet-wensen">[cred_i18n name='eventuele-dieet-wensen-label']Eventuele dieet wensen[/cred_i18n]</label>
			[cred_field field='eventuele-dieet-wensen' force_type='field' class='form-control' output='bootstrap']
		</div>
      <div class="row">
      <p class="formtitle"><strong>Factuurgegevens</strong></p>
		<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,
  "persist": 1,
"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>

	<div class="row">
		<div class="col-md-12">
			[cred_field field='form_submit' output='bootstrap' value='Werk gegevens bij' class='fusion-button button-flat fusion-button-default-size button-default fusion-button-default button-2 fusion-button-default-span fusion-button-default-type']
		</div>
	</div>
</div>
[/creduserform]

It has this as form for the billing part hidden link.

Why isn't it showing me the billing info there is in the profile of my user?

Cheers
Marco

#2689057

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

Hi Marco

Generic fields such as those you have added to your form are submitted along with the form but then discarded unless you do something with them. The expectation is that you would use the API, for example the cred_save_data hook, to then process the generic fields.

If you just want to save the data with the same meta key as the slug as used in the form then you can add a persist parameter to the generic field JSON settings, e.g.

[cred_generic_field type='textfield' field='billing_email']
{
"required":0,
"default":"",
"persist":1
}
  [/cred_generic_field]

Das Thema „[Geschlossen] Woocommerce billing fields show but no info is filled in from user“ ist für neue Antworten geschlossen.