Skip Navigation

[Resuelto] Conditional output based on cart input : repost

This support ticket is created hace 2 años, 8 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Pat hace 2 años, 8 meses.

Autor
Mensajes
#2323689

Pat

Hello,

I'm coming back to one of my previews ticket (https://toolset.com/forums/topic/conditional-output-based-on-cart-input/).
Nigel explained (You'll need to write a custom function to check if a product is in the cart, and you can then use the results of that function in your condition).
I would like to know what should be the result of this function to be used inside a Toolset conditional. Should it be a true / false result or something else? When used in a conditional in general, what is the expression that the condition is waiting for (in order to built the function returning exactly this expression).

Regards
Pat

#2323819

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Hi Pat

Your function can return whatever you want, and then the condition tests whether what is returned by the function matches some value you specify.

It's not easy to handle boolean true/false values in this way, and typically you would do something like return 1 or 0 (for true or false).

#2326767

Pat

Got it.
Thanks Nigel.
Regards
Pat