Created
November 8, 2019 18:32
-
-
Save robertdevore/b10f279a87e169c9105e962230b4fc55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function dtwc_add_delivery_info_to_vendor_emails( $fields, $sent_to_admin, $order ) { | |
if ( $email->id == 'vendor_new_order' ) { | |
$order_id = $order->get_id(); | |
} else { | |
$order_id = $order->id; | |
} | |
// Set the delivery date. | |
$delivery_date = get_post_meta( $order_id, 'dtwc_delivery_date', true ); | |
$delivery_date = date( apply_filters( 'dtwc_date_format', 'M j, Y' ), strtotime( $delivery_date ) ); | |
if ( '' != $delivery_date ) { | |
$fields[ dtwc_delivery_date_label() ] = array( | |
'label' => dtwc_delivery_date_label(), | |
'value' => $delivery_date, | |
); | |
} | |
return $fields; | |
} | |
add_action( 'woocommerce_email_before_order_table', 'dtwc_add_delivery_info_to_vendor_emails', 20, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment