Skip Navigation

[Resolved] display custom field only for certain values

This support ticket is created 2 years, 9 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: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Clay 2 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#2128345
Screen Shot 2021-07-28 at 5.28.46 PM.png

Tell us what you are trying to do?
I have created some custom fields for my woocommerce products. I want to display one of them on my single product template only when it contains certain values. The screenshot show the field options. I want to display the field only it it is not equal to "sold" or "available."

Is there any documentation that you are following?
tried the support forum but couldn't find this particular scenario

Is there a similar example that we can see?

What is the link to your site?
hidden link

#2128375

this is the code I'm using (that isn't working):

[wpv-conditional if="( $(wpcf-work-status) ne 'sold' ) AND ( $(wpcf-work-status) ne 'available' )"][types field='work-status'][/types][/wpv-conditional]

The conditional seems to work...the field appears on the correct products. But it displays

[types field='work-status'][/types]

rather than the contents of the field.

#2128595

Hello,

The problem you mentioned above is abnormal, please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme 2021, deactivate all custom PHP/JS code snippets, and test again

3) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, also point out the problem page URLs, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#2130139

I was building my template with the Divi theme builder. I switched to a Toolset template and was able to implement the conditionals.

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