Change PDF Title on template
-
Hi!
I have a custom template and inside it I have two documents, enquiry.php and invoice.php.
I would like to change titles from Invoice to Quote.
These filters does what I want, but unsure how to set this for the enquiry document only:
add_filter( 'wpo_wcpdf_invoice_title', 'wpo_wcpdf_invoice_title', 10, 2 ); function wpo_wcpdf_invoice_title ( $title, $document ) { if ($template_type == 'invoice' ) { $title = 'Quote'; return $title; } } add_filter( 'wpo_wcpdf_filename', 'wpo_wcpdf_custom_filename', 10, 4 ); function wpo_wcpdf_custom_filename( $filename, $template_type, $order_ids, $context ) { $invoice_string = _n( 'invoice', 'invoices', count($order_ids), 'woocommerce-pdf-invoices-packing-slips' ); $new_prefix = _n( 'quote', 'quotes', count($order_ids), 'woocommerce-pdf-invoices-packing-slips' ); $new_filename = str_replace($invoice_string, $new_prefix, $filename); return $new_filename; }
Any help would be appreciated!
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Change PDF Title on template’ is closed to new replies.