How to change default PDF invoice file name?

Generally, the Challan PDF Invoice for WooCommerce plugin generates PDFinvoice filename “Invoice-${order_number}.pdf” like this. Here is the way to change the default PDF invoice filename.

1 ) Install the “Code Snippets” plugin from wordpress.org

2 ) Add new snippets

3 ) Here is the filter name and basic structure you should use.

add_filter( 'woo_invoice_file_name', 'woo_invoice_file_name_callback', 10, 3 );

function woo_invoice_file_name_callback( $filename, $template, $order_id ) {
    return 'custom_filename'; // Replace 'custom_filename' with your desired custom name for the PDF invoice
}
Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.