Add Delivery Date And Time To Print Invoice & Delivery Notes For WooCommerce By Tyche Softwares

To add the delivery date and time from WooCommere Delivery Slots to your invoices, delivery notes, and receipts generated by the “Print Invoice & Delivery Notes for WooCommerce” by Tyche Softwares, you can use the following code.

To use the code, add it to your child theme’s functions.php file.

/**
 * Add delivery date and time to Print Invoice & Delivery Notes for WooCommerce by Tyche Softwares.
 *
 * @param array    $fields
 * @param WC_Order $order
 *
 * @return array
 */
function iconic_add_invoice_fields( $fields, $order ) {
	$delivery_date = $order->get_meta( 'jckwds_date' );
	$delivery_time = $order->get_meta( 'jckwds_timeslot' );

	if ( $delivery_date ) {
		$fields['iconic_wds_delivery_date'] = array(
			'label' => __( 'Delivery Date', 'iconic' ),
			'value' => $delivery_date,
		);
	}

	if ( $delivery_time ) {
		$fields['iconic_wds_delivery_time'] = array(
			'label' => __( 'Delivery Time', 'iconic' ),
			'value' => $delivery_time,
		);
	}

	return $fields;
}

add_filter( 'wcdn_order_info_fields', 'iconic_add_invoice_fields', 10, 2 );

WooCommerce Delivery Slots

Choose a delivery date and time for each order. Add a limit to the number of allowed reservations, restrict time slots to specific delivery methods, and so much more.

Was this helpful?

Please let us know if this article was useful. It is the best way to ensure our documentation is as helpful as possible.