This support ticket is created hace 3 años, 4 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.
I need to allow the ADD TO CART button on the product page only between 2 specific dates.
For this, I have created 2 custom fields (wpcf-date-debut-inscription-site and wpcf-date-fin-inscription-site) enabling date and time.
These custom fields are linked to a specific postype (variables) and I have created a post (ID 18207) in order to define these dates.
I have also created 2 hooks :
You have registered the function date_debug_ins as a callback for a shortcode, but you don't use the shortcode inside your condition, you use the function directly, so declaring the shortcode seems redundant.
If these fields are Types date fields then, yes, they are stored as timestamps (number of seconds since 1 Jan 1970).
In your condition you are comparing them to SECONDS_FROM_NOW(0). I'm not entirely sure what this is, or what format it returns, but in any case if your intention is to compare them to the current date/time then you can simply use the native PHP function time(), which will return the current date/time as a timestamp (i.e. the same format that Types date fields are stored in).