PDF Invoice - How to show shipments on the invoice

How to display the data for the shipping on the invoice. You can be added in the section of the bill notes with this php code snippets pasted into functions.php

 

if( function_exists( 'YITH_PDF_Invoice' ) ){
if( ! function_exists( 'yith_ywpi_print_document_notes' ) ){
function yith_ywpi_print_document_notes( $notes, $document ){
if( is_object( $document ) && ! empty( $document->order ) && $document->order instanceof WC_Order){
/**
* @var $order WC_Order
*/
$order = $document->order;
$shipping_info = sprintf( '<strong>%s:</strong> %s<br><strong>%s:</strong><br>%s', __( 'Shipping Method', 'theme-text-domain' ), $order->get_shipping_method(), __( 'Shipping Address', 'theme-text-domain' ), $order->get_formatted_shipping_address() );
$notes .= $shipping_info;
}
return $notes;
}
}
add_filter( 'yith_ywpi_print_document_notes', 'yith_ywpi_print_document_notes', 10, 2 );
}
Was this article helpful?
0 out of 1 found this helpful

Back to Help Center

Powered by Zendesk