WordPress.org

Plugin Directory

WooCommerce PDF Invoices

Automatically generate and attach customizable PDF Invoices to WooCommerce emails and connect with Dropbox, Google Drive, OneDrive or Egnyte.

How to add your custom template?

To easily get started, copy the default template files (including folder) called plugins/woocommerce-pdf-invoices/includes/templates/invoices/simple/micro to uploads/bewpi-templates/invoices/simple and rename the template folder micro to a template name you like. This way the plugin will detect the template and makes it available to select it within the template settings tab. Now go ahead en start making some changes to the template files! :)

How to add a fee to the invoice?

To add a fee to your invoice, simply add the following action to your themes functions.php.

add_action( 'woocommerce_cart_calculate_fees','add_woocommerce_fee' );
function add_woocommerce_fee() {
    global $woocommerce;

    if ( is_admin() && ! defined( 'DOING_AJAX' ) )
        return;

    $amount = 5;
    $woocommerce->cart->add_fee( 'FEE_NAME', $amount, true, 'standard' );
}

How to hide order item meta?

To hide order item meta from the invoice, simply add the following filter to your themes functions.php.

add_filter( 'woocommerce_hidden_order_itemmeta', 'add_hidden_order_items' );
function add_hidden_order_items( $order_items ) {
    $order_items[] = '_subscription_interval';
    $order_items[] = '_subscription_length';
    // end so on...

    return $order_items;
}

How to change PDF margins/options?

To change the options of the PDF, use below example.

function custom_bewpi_mpdf_options( $options ) {
    $options['mode'] = '';
    $options['format'] = '';
    $options['default_font_size'] = 0;
    $options['default_font'] = 'opensans';
    $options['margin_left'] = 14;
    $options['margin_right'] = 14;
    $options['margin_top'] = 14;
    $options['margin_bottom'] = 0;
    $options['margin_header'] = 14;
    $options['margin_footer'] = 6;
    $options['orientation'] = 'P';
    return $options;
 }
 add_filter( 'bewpi_mpdf_options', 'custom_bewpi_mpdf_options' );

How to display invoice download button on specific template files?

Let customers download there invoices from specific template pages by using below shortcode.

echo do_shortcode( '[bewpi-download-invoice title="Download (PDF) Invoice {formatted_invoice_number}" order_id="ORDER_ID"]' );

To use shortcode in WordPress editor:

[bewpi-download-invoice title="Download (PDF) Invoice {formatted_invoice_number}" order_id="ORDER_ID"]

How to change direction of invoice to RTL?

To change the direction of the invoice to RTL or something else, add below filter to your themes functions.php.

function bewpi_mpdf( $mpdf ) { $mpdf->SetDirectionality( 'rtl' ); return $mpdf; } add_filter( 'bewpi_mpdf', 'bewpi_mpdf' );

Images doesn't display on invoice?

Enable mPDF debugging on General Settings tab in order to output errors. Not recommended on live site!

Requires: 3.8 or higher
Compatible up to: 4.4.2
Last Updated: 1 day ago
Active Installs: 7,000+

Ratings

4.9 out of 5 stars

Support

22 of 58 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1 100,1,1 100,1,1 100,1,1
100,2,2 100,2,2 100,1,1 100,1,1
100,1,1 100,3,3 100,2,2
100,1,1 100,1,1 100,2,2 50,2,1
100,1,1
100,1,1
0,1,0 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,2,2 100,1,1 100,1,1 100,1,1 50,2,1 100,1,1 100,1,1 100,1,1
100,1,1
100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,2,2 100,1,1 100,1,1 100,2,2 50,2,1 100,3,3 100,1,1
100,1,1
100,1,1 100,1,1 100,1,1 100,1,1
100,1,1
100,2,2 100,1,1 100,1,1 100,1,1 50,2,1
100,2,2