WP Ultimo offers the option to send PDF invoices after a payment is received (and in some cases, like the Manual Gateway, when a pending payment is created). It might be useful and/or necessary to add extra information on that invoice, like a legal notice, and to be able to make changes to the From and To fields of the invoice.

Modifying the From and To fields

Each invoice has two separated columns to contain information from your company and the client. WP Ultimo exposes two different hooks to allow you to customize what information gets displayed on those columns: wu_invoice_from and wu_invoice_to.

add_filter('wu_invoice_to', function($lines, $client_id) { // When usign the wu_invoice_to filter, $user_id is passed to the callback

  return array(
    'Each item in the array',
    'Gets added as a different line'
  );

}, 10, 2);

Adding information to the bottom of the Invoice

To add information to the bottom of the invoice you can make use of the filter wu_invoice_bottom_message. There are two ways of displaying information: if you return an array with ‘title’ and ‘message’, both elements will be displayed; if a string is returned, only the message will be displayed.

/** 
 * Example returning an array of title and message
 */
add_filter('wu_invoice_bottom_message', function() {

  return array(
    'title'   => 'Legal Notice',
    'message' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas faucibus iaculis nisl non pulvinar. Proin a turpis neque. Nam volutpat risus sit amet libero sagittis sagittis. Sed id interdum libero. Vestibulum porta, lacus sed rutrum dapibus, eros ipsum imperdiet velit, faucibus dictum eros purus sit amet diam. Nunc lobortis quis.',
  );

});
add_filter('wu_invoice_bottom_message', function() {

  return 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas faucibus iaculis nisl non pulvinar. Proin a turpis neque. Nam volutpat risus sit amet libero sagittis sagittis. Sed id interdum libero. Vestibulum porta, lacus sed rutrum dapibus, eros ipsum imperdiet velit, faucibus dictum eros purus sit amet diam. Nunc lobortis quis.';

});
Did this answer your question?