Skip Navigation

[Resolved] Conditional statement

This support ticket is created 4 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
- 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 2 replies, has 2 voices.

Last updated by jelle-jacobd 4 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1602945

Hi,

Why isn't the code below showing the row if the attribute is present for a product? If it is not available for a product, the entire row should be hidden. I tried several options with false/true etc, but it just doesn't seem to work. What am I doing wrong here?

In my opinion the statements is claiming: if the attribute is NOT empy show the row, correct?

[wpv-conditional if="( CONTAINS(#(pa_subkleur),'') )" evaluate="false"]
<tr>
<th>Subkleur</th>
<td>: [wpv-post-taxonomy type="pa_subkleur" format="name"]</td>
</tr>
[/wpv-conditional]

Thanks!

#1603857

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I am not sure why you are trying to make things complicated as you can always use the [wpv-post-taxonomy] shortcode to check if any terms are assigned to that post or not.

For example:

[wpv-conditional if="( '[wpv-post-taxonomy type="pa_subkleur" format="slug"]' eq '' )"]
<tr>
<th>Subkleur</th>
<td>: [wpv-post-taxonomy type="pa_subkleur" format="name"]</td>
</tr>
 [/wpv-conditional]
#1604469

Hi Minesh,

I'm not sure either, kinda easy this way, sorry.. I just used the selection available from the menu. Looks like your code should be adde from custom declarations? It is not available by default?