• Resolved tombaslin

    (@tombaslin)


    Hello there,

    I need to change the PDF filename in the free version. I already found this code:

    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( 'booking', 'bookings', count($order_ids), 'woocommerce-pdf-invoices-packing-slips' );
        $new_filename = str_replace($invoice_string, $new_prefix, $filename);
     
        return $new_filename;
    }

    In my italian version of the plugin I get “fattura” instead of “invoice”. This is the proper translation but I would need “certificato”. What should I change of that code in order to make it working?

    Thank you in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    You would need to replace this part:

    
    $new_prefix = _n( 'booking', 'bookings', count($order_ids), 'woocommerce-pdf-invoices-packing-slips' );
    

    with:

    
    $new_prefix = _n( 'certificato', 'certificatos', count($order_ids), 'woocommerce-pdf-invoices-packing-slips' );
    

    More information: Custom PDF filenames (scroll down for the section about the free version)

    Thread Starter tombaslin

    (@tombaslin)

    Thank you a lot @pomegranate !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to change the PDF filename in Free version?’ is closed to new replies.