• Resolved polug

    (@polug)


    Hi,
    is there a way to override the document name “INVOICE” in the invoice based on the type of order?
    When an order is created by a customer the type is “web order”. We are also using the plugin “POS”, when we create an order with POS the order type is “pos order”.
    Depending on the order type there should be another title in the invoice pdf.

    Example:
    if order type == “web order” –> title in pdf incoice = “INVOICE“;
    if order type == “pos order” –> title in pdf invoice = “POS INVOICE“;

    Thanx, this would help us a lot!

    Regards,
    Gert

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @polug

    How do you set that type? Is order meta data?

    Let me know.

    Thread Starter polug

    (@polug)

    Hi,
    I have found a solution by selecting the payment method.
    Thx
    G

    add_filter( ‘wpo_wcpdf_invoice_title’, ‘wpo_wcpdf_invoice_title’, 10, 2 );
    function wpo_wcpdf_invoice_title ( $title, $document = null ) {
    $title = “INVOICE”;
    if (!empty($document) && !empty($document->order)) {
    if ( $document->order->get_payment_method() === ‘pos_cash’ ) {
    $title = ‘POS INVOICE’;
    }

    }
    return $title;

    Plugin Contributor alexmigf

    (@alexmigf)

    Glad you find a way.

    Have a nice day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customise title in invoice pdf’ is closed to new replies.