woocommerce_printable_order_receipt_data filter-hookWC 9.0.0

Filter to customize the set of data that is used to render the receipt. The formatted line items aren't included, use the woocommerce_printable_order_receipt_formatted_line_item filter to customize those.

See the value returned by the 'get_order_data' and 'get_woo_pay_data' methods for a reference of the structure of the data.

See the template file, Templates/order-receipt.php, for reference on how the data is used.

Usage

add_filter( 'woocommerce_printable_order_receipt_data', 'wp_kama_woocommerce_printable_order_receipt_data_filter', 10, 2 );

/**
 * Function for `woocommerce_printable_order_receipt_data` filter-hook.
 * 
 * @param array    $data  The original set of data.
 * @param WC_Order $order The order for which the receipt is being generated.
 *
 * @return array
 */
function wp_kama_woocommerce_printable_order_receipt_data_filter( $data, $order ){

	// filter...
	return $data;
}
$data(array)
The original set of data.
$order(WC_Order)
The order for which the receipt is being generated.

Changelog

Since 9.0.0 Introduced.

Where the hook is called

ReceiptRenderingEngine::generate_receipt()
woocommerce_printable_order_receipt_data
woocommerce/src/Internal/ReceiptRendering/ReceiptRenderingEngine.php 134
$data = apply_filters( 'woocommerce_printable_order_receipt_data', $this->get_order_data( $order ), $order );

Where the hook is used in WooCommerce

Usage not found.