Documentation

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 );

Are you using WooCommerce Delivery Slots yet?

Start your 14-day free trial right now and get instant access to the features described in this article.

or learn 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.

WooCommerce Delivery Slots

WooCommerce Delivery Slots

Not got the plugin yet? Get instant access right now, free for 14 days.

or learn more

Still need help?

If you haven't found what you're looking for in our documentation, please contact support.

Get Support