Skip Navigation

[Resolved] conditional group to display field value not working properly

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

Supporter timezone: Africa/Casablanca (GMT+00:00)

This topic contains 3 replies, has 3 voices.

Last updated by salimA 2 years, 7 months ago.

Assisted by: Jamal.

Author
Posts
#2168607
Capture.JPG

Dears,

I have three conditional groups, the first and second are working fine. but the third one is not working even if all values are correct.

[cred_show_group if="( $(request-status) eq '1' ) AND ( $(payment) eq '1' )" mode="none"]

<label>[cred_i18n name='payment-label']Payment Status: [/cred_i18n]</label>
[types usermeta='payment' current_user='true'][/types]<br>
<b>Please Click Here to Complete the Payment Process <a href = 'hidden link Now</a></b>
<br><label>[cred_i18n name='payment-label']Account Status: [/cred_i18n]</label>
[types usermeta='user-account-status' current_user='true'][/types]
[/cred_show_group]
---------------------------------------
[cred_show_group if="( $(request-status) eq '1' ) AND ( $(payment) eq '2' )" mode="none"]

<label>[cred_i18n name='payment-label']Payment Status: [/cred_i18n]</label>
<b>[types usermeta='payment' current_user='true'][/types]</b><br>
<label>[cred_i18n name='account-status-label']Account Status: [/cred_i18n]</label>
[types usermeta='user-account-status' current_user='true'][/types]<br>

[/cred_show_group]
-----------------------------------------
[cred_show_group if="( $(request-status) eq '1' ) AND ( $(payment) eq '2' ) AND ( $(user-account-status) eq '1' )" mode="none"]

<label>[cred_i18n name='payment-label']Payment Status: [/cred_i18n]</label>
<b>[types usermeta='payment' current_user='true'][/types]</b><br>
<label>[cred_i18n name='account-status-label']Account Status: [/cred_i18n]</label>
[types usermeta='user-account-status' current_user='true'][/types]<br>
<label>[cred_i18n name='expiration-date-label']Expiration Date: [/cred_i18n]</label>
[types usermeta='expiration-date' current_user='true'][/types]

[/cred_show_group]

----------------------------------------

the fields type and options as on below;

Request status (Radio) --> 1 - approved / 2- rejected
payment status (select) --> 1- unpaid / 2- paid
Activate (check box)--> 0 - inactive / 1- Active

#2168949

Nigel
Supporter

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

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

The problem is with this condition?

[cred_show_group if="( $(request-status) eq '1' ) AND ( $(payment) eq '2' ) AND ( $(user-account-status) eq '1' )" mode="none"]

What's different about that condition is that it contains a user custom field, user-account-status, correct?

What kind of form is this? I'm not sure I understand what I'm looking at, as you seem to be outputting user field values in a form rather than offering inputs for those fields. I don't know if you have inputs for these fields somewhere else on the form...

#2168963

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting Toolset support.

I am really confused because you are using the cred_show_group shortcode with the types shortcode. Is this a form or a view/content template/archive?

The cred_show_group shortcode is meant to be used in forms. And I would expect that you use the cred_field shortcode instead of the types shortcode, which is supposed to be used in views/content template/archives.

Would you like to reproduce this issue on one of our test sites? If yes, please login with this URL hidden link

#2169635

Yes, it is a user form. there are CRED fields and types . I found that I did not add the expiration date as a CRED field in the form that is why I am not able to retrieve the value in the types.

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.