Skip Navigation

[Resolved] Conditional Group using a Custom Field

This support ticket is created 3 years, 10 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by joeW-6 3 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1649523
Figure 4.JPG
Figure 2.JPG
Figure 3.JPG
Figure 1.JPG

I created a custom field type "radio" to select if a company has paid for an order or if not they are listed as pending. (Figure 1)

I have then used a conditional group in a post form to display only if the company is listed as paid:

[cred_show_group if="( $(paid-or-pending-order) eq 'Paid Company' )" mode="fade-slide"]<div class="section-wrapper">
<div class="row">
<div style="text-align:left; padding-bottom:20px" class="col-md-6">
<div style="font-size:13px; line-height: 18px;">HINT: Make your Company Portal Page available to the public (Live mode) or remain hidden from the public (Draft Mode).</div>
</div>
<div style="text-align:left; padding-bottom:20px" class="col-md-3">
[cred_field field="company-live-status" force_type="field" class="form-check-input" output="bootstrap"]
</div>
<div style="text-align:right; padding-bottom:20px" class="col-md-3">
<a class="button" href="[wpv-post-url]" target="_blank" rel="noopener noreferrer">Preview</a>
[cred_field field='form_submit' output='bootstrap' value='Save' class='button']
</div>
</div>
</div>[/cred_show_group]

I have no idea why this won't work- I have created multiple custom fields and I am not sure what the issue is. Figure 2 is what shows on a company page that has paid, when it should show figure 3. The company is checked off as a paid company (Figure 4).

Now if I change the conditional group to display if the field doesn't equal Pending Company, this makes the code slide in and then instantly disappears.

#1649913

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand you are using Toolset post edit form.

Now, with this post edit form, you want to display conditional content on your edit form based on the radio button option checked from backend (edit post page) - correct?

And you do not want to display the radio button on the form on the frontend - is this correct?

If yes: Can you please share problem URL where I can see the form as well as do I need to loggedin as different user? If yes: Please share access details for the user to login.

#1650617

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok as you do not want to display the radio field with your form.

You should try to use the [wpv-conditional] shortcode to display your conditional fields. You need to wrap your conditional content with [wpv-conditional] shortcode.

For example:

[wpv-conditional if="( '[types field='course-registration-url' output='raw'][/types]' eq 'Paid Company' )"]
   // your content goes here
[/wpv-conditional]

[wpv-conditional if="( '[types field='course-registration-url' output='raw'][/types]' eq 'Pending Company' )"]
   // your content goes here
[/wpv-conditional]

Can you please try above and check if that help you to resolve your issue.

#1651047

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.