Conditional payment in WooCommerce
Budget: €30 – €250 EUR
Greetings,
I have a booking created with WooCommerce and WooCommerce Product Add-Ons Ultimate (PluginRepublic.com).
With this last plugin I have created a date field (d / m / Y) and a dropdown to choose the time.
My goal is to enable payment with "Cash on Delivery" if the difference between the current time (timestamp) and the time selected by the customer (date field+dropdown) is less than 24 hours.
For example, today is September 14, 2021 and it is 12.00 (2021/09/14 12:00) , the customer in the booking module has booked a ride for tomorrow at 11. So, 2021/09/14 12:00 minus 2021/09/15 11:00 is less than 24 hours, so the only payment available is "Cash on Delivery", on the contrary, all payment methods would be available.
I would like this change to be done only through functions.php
I have a booking created with WooCommerce and WooCommerce Product Add-Ons Ultimate (PluginRepublic.com).
With this last plugin I have created a date field (d / m / Y) and a dropdown to choose the time.
My goal is to enable payment with "Cash on Delivery" if the difference between the current time (timestamp) and the time selected by the customer (date field+dropdown) is less than 24 hours.
For example, today is September 14, 2021 and it is 12.00 (2021/09/14 12:00) , the customer in the booking module has booked a ride for tomorrow at 11. So, 2021/09/14 12:00 minus 2021/09/15 11:00 is less than 24 hours, so the only payment available is "Cash on Delivery", on the contrary, all payment methods would be available.
I would like this change to be done only through functions.php