I've tried adding the following code to my page
<h1>TESTING CONDITIONAL IF</h1>
{!{wpv-conditional if='( has_term() eq 'ventilatoren' )'}!}
<h1>TESTING VENTILATOREN TERM</h1>
{!{wpv-view name='artikel-specificaties'}!}
{!{/wpv-conditional}!}
+
{!{wpv-conditional if='( $(wpcf-artikelnummer) eq '22' )'}!}
<h1>MY ARTICLE NUMBER</h1>
{!{/wpv-conditional}!}
Link to a page where the issue can be seen:
hidden link
I expected to see:
Since "22" is filled in the articl-number-field and the term "ventilatoren" is checked i expect to see the content inside the conditional
SCREENSHOT: hidden link
-------
Extra question which is related to what im asking above is:
I've also tried to add simuluar code to a woocommerce tab. Is it possible to add the following code to woocommerce tabs ?
1. The following code does not work at all. It displays this code (see screenshot)
{!{wpv-conditional if='( has_term() eq 'ventilatoren' )'}!}
<h1>TESTING VENTILATOREN TERM</h1>
{!{wpv-view name='artikel-specificaties'}!}
{!{/wpv-conditional}!}
2. The following code does not work at all. It displays nothing
[wpv-conditional if='( has_term() eq 'ventilatoren' )']
<h1>TESTING VENTILATOREN TERM</h1>
[wpv-view name='artikel-specificaties']
[/wpv-conditional]
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
Well - I see that you are using wrong syntax to check taxonomy terms conditionally.
For example:
[wpv-conditional if="( has_term('Chinese', 'foreign-language', null) eq '1' )" ]
<p class="special">This consultant speaks Chinese!</p>
[/wpv-conditional]
where:
Replace 'foreign-language' with your original taxonomy slug.
Please do not forget to register the has_term function at:
=> Toolset => Settings => Front-end Content tab => Functions inside conditional evaluations
More info:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/displaying-taxonomies-conditionally/#specific
Regarding your 2nd issue to check "wpcf-artikelnummer " with condition I need to check on your install whats going wrong there.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Glad to know that you are able to display conditional output using taxonomy terms.
No - I do not have any idea why its not working with "WooCommerce Tag Manager Plugin". You may create a new ticket and share all required information and we are happy to help you further and we will try to check why its not working with the said plugin.
This will help other users searching on the forum. Thank you for understanding.