Hello! I have a question about whether you can put a double conditional.
In this case I need here:
<td> [type field = "expiration-date"] [/ types] <br> [wpv-conditional if = "($ (wpcf-expiration-date) lt 'TODAY ()')"] <b> EXPIRED </b> [/ wpv-conditional] </td>
The expired is only shown if one of the forms in the rest of the columns is not complete like [cred_form form="adjunto-bonos"]
the complete code of the view is as follows. Could you help me?
<td>[types field='nombre_campana' separator=', ' item='@campana-bonos-bono.parent'][/types]</td>
<td>[types field="referencia-del-bono"][/types]</td>
<td>[types field="fecha-de-creacion-del-bono"][/types]</td>
<td>[types usermeta="telefono_movil" user_is_author="true"][/types]<br>[wpv-post-author format="meta" meta="user_email"] </td>
<td>
[wpv-conditional if="( $(wpcf-comprobante) eq '' )"]
[cred_form form="adjunto-bonos"]
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-comprobante) ne '' )"]
[types field='comprobante'][/types]
[/wpv-conditional]</td>
<td>[wpv-view name="child-view"]</td>
<td> [types field="fecha-de-caducidad"][/types]<br>[wpv-conditional if = "($(wpcf-fecha-de-caducidad) lt 'TODAY()')"] <b>CADUCADO</b> [/wpv-conditional]</td>
Hello,
Please elaborate the questions with more details:
The expired is only shown if one of the forms in the rest of the columns is not complete like [cred_form form="adjunto-bonos"]
Are you going display something different after user submit the Toolset post form?
If it is, you can try the option:
After visitors submit this form: Display a message instead of the form...
Hi Luo,
Expired date is in other column. Therefore it is not a consequence of sending the form 'adjunto-bonos'. But I want that if I submit this form, the word 'caducado' doesnt dispkay, even if 2 days have passed since the creation of the 'bono', which is currently when the word CADUCADO is included.
You can see view here.
/listado-bonos-administrador/
Please provide your website credentials in below private message box, also point out the problem page URLs and form URLs, I need to test it in a live website, thanks
Thanks for the details, I assume we are talking about this post form "Adjunto bonos":
hidden link
It is a post form for editing "Bonos" post.
For the question:
But I want that if I submit this form, the word 'caducado' doesnt dispkay
You can add another custom field(for example "my-field") into post form "Adjunto bonos", after user submit that form, change the custom field "my-field" value to something else.
Then use wpv-conditional shortcode to check "my-field" field value, display the text "caducado"
More help:
https://toolset.com/course-lesson/creating-custom-fields/
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional
Hi Luo,
I'm trying to make it simpler, and just do it with a form.
If there is 'comprobante' remove the word 'caducado'
Could you help me?
You can edit the post view "Listado bonos administrador":
hidden link
In section "Loop item in Listado bonos administrador", replace this code from:
[wpv-conditional if = "($(wpcf-fecha-de-caducidad) lt 'TODAY()') "] <b>CADUCADO</b> [/wpv-conditional]
With:
[wpv-conditional if = "($(wpcf-fecha-de-caducidad) lt 'TODAY()') OR ($(wpcf-comprobante) nq '') "] <b>CADUCADO</b> [/wpv-conditional]
Hi Luo,
If I put that code 'Expired' it doesnt display in any case.
That is because that you have already setup one condition:($(wpcf-fecha-de-caducidad) lt 'TODAY()')
Do you need it or not? If you don't need it, you can remove it, for example:
[wpv-conditional if = " ($(wpcf-comprobante) nq '') "] <b>CADUCADO</b> [/wpv-conditional]
More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional
Hi Luo,
The conditional should be the following, but it doesn't work for me. Where am I failing?
<td> [types field="fecha-de-caducidad"][/types]<br>[wpv-conditional if = "($(wpcf-fecha-de-caducidad) lt 'TODAY()')" AND "( $(wpcf-comprobante) eq '' )" ] <b>CADUCADO</b> [/wpv-conditional] </td>
There is an extra double quotes in the codes you mentioned above.
I have changed the codes in your website as below:
[wpv-conditional if = "($(wpcf-fecha-de-caducidad) lt 'TODAY()') AND ( $(wpcf-comprobante) eq '' ) "] <b>CADUCADO</b> [/wpv-conditional]
Please test it, check if it is fixed, thanks
My issue is resolved now. Thank you!