Skip to content
Advertisement

Add minutes to time based on current time

I am trying to figure out a way to change a value based on current time, currently I am using the following code to add certain minutes the time the order is placed.

JavaScript

which is working fine (except for $minutes_to_add = 170 is only adding only 30 minutes to the current time for some reason but I am living with it) BUT then I found a need to change the $minutes_to_add value to different value based on the current time (or mainly the time of order, I wrote the following code and tested on WooCommerce but it is giving critical error and not passing the order details.

JavaScript

Advertisement

Answer

I found the solution, will post it in case someone needs it.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement