Fill delivery date/time for Order Delivery Date Pro for WooCommerce
1. Visit >WooCommerce>Phone Orders>Settings>Custom fields and paste following text to 1st textarea.
Adjust time slots to match yours!!
1 2 |
Delivery Date|_orddd_timestamp|date Time Slot|_orddd_time_slot|select|00:00 - 08:00|12:00 - 19:00 |
2. Add this PHP code to functions.php OR using https://wordpress.org/plugins/code-snippets/
1 2 3 4 5 6 7 |
add_action( 'woocommerce_checkout_phone_order_processed', function($order_id, $data, $order ){ $date = $order->get_meta("_orddd_timestamp"); $order->update_meta_data('Delivery Date', $date ); $order->update_meta_data('_orddd_timestamp', strtotime($date) ); $order->update_meta_data('Time Slot', $order->get_meta("_orddd_time_slot") ); $order->save(); },10,3); |