Action Hooks Reference - Woo Invoice

Woo Invoice includes several action hooks where you can output order meta, product meta or custom content. Below is the list of available hooks:

Action Hook Position Arguments
woo_invoice_custom_style
Add CSS Style to Invoice
woo_invoice_before_document
Header of the Invoce template $order, $template_type
(invoice or packing-slip)
woo_invoice_after_document
Footer of the Invoce template $order, $template_type 
(invoice or packing-slip)
woo_invoice_after_document_label
After Invoice Title at header $order, $template_type 
(invoice or packing-slip)
woo_invoice_before_billing_address
Before Billing or Shipping Address $order, $template_type 
(invoice or packing-slip)
woo_invoice_after_billing_address
After Billing or Shipping Address $order, $template_type 
(invoice or packing-slip)
woo_invoice_before_order_data
Before order details  $order, $template_type 
(invoice or packing-slip)
woo_invoice_after_order_data
After order details $order, $template_type 
(invoice or packing-slip)
woo_invoice_before_product_list
Before the product list table  $order, $template_type 
(invoice or packing-slip)
woo_invoice_after_product_list
After  the product list table $order, $template_type 
(invoice or packing-slip)
woo_invoice_before_item_meta
Before Product info $product, $order, $template_type 
(invoice or packing-slip)
woo_invoice_after_item_meta
After Product info $product, $order, $template_type 
(invoice or packing-slip)
woo_invoice_before_customer_notes
Before order note $order, $template_type 
(invoice or packing-slip)
woo_invoice_after_customer_notes
After order note $order, $template_type 
(invoice or packing-slip)

Example 1: Add order meta to order details section

add_action( 'woo_invoice_after_order_data', 'woo_invoice_delivery_date', 10, 2 );
function woo_invoice_delivery_date ($order,$template_type) {
    if ($template_type == 'invoice') {
        // get the delivery date from the order
        $delivery_date = $order->get_meta('delivery_date');
        // convert date according to WooCommerce/WordPress date format settings)
        $formatted_delivery_date = date_i18n( wc_date_format(), $delivery_date );
        ?>
        <span>Delivery Date: <?php echo $formatted_delivery_date; ?></span>
	<?php
    }
}

Still need help? Contact Us Contact Us