Skip Navigation

[Resolved] Pre Filling Buyer's contact request form

This support ticket is created 6 years, 1 month 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 6 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#1122590

Hi, I have seller listings on my portal. Visitors need to request contact details to be able to connect the listing providers. There are 2 scenarios out here. A) Non Logged In users B) Logged in Users.

The contact request form remains same for both, however, for the logged in users, I want the form to be partially pre-filled ie, with their name, number, email and they just need to give some additional info vis a vis - non logged in users.

How can I do that with CRED?

Thank You?

#1122746

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

I assume there is a Toolset Form to publish posts underlying this (e.g. to publish "contact requests" or similar).

You can set the value attribute with a shortcode that outputs the relevant field for the current user, or you may be using generic fields in the form if you don't need to save the details, something like:

[cred_generic_field type='email' field='email-address']
{
"required":0,
"validate_format":0,
"default":"[wpv-user field="user_email"]"
}
[/cred_generic_field]

// or for a Types field

[cred_field field="email-address" value='[wpv-user field="user_email"]']

In any case, if a guest user visits such a form, the wpv-user or types user_meta shortcodes won't output anything, and so the default value will simply be blank.

You should be able to output the shortcode in the correct format simply by using the Fields and Views button.