How do I change common PDF options?

In order to change the more common options for your PDFs, simply add the following action to your themes functions.php function custom_bewpi_mpdf_options( $options ) { $options[‘mode’] = ”; $options[‘format’] = ”; // use [format]-L or [format]-P to force orientation (A4-L will be size A4 with landscape orientation) $options[‘default_font_size’] = 0; $options[‘default_font’] = ‘opensans’; $options[‘margin_left’] = 14; $options[‘margin_right’] Read more about How do I change common PDF options?[…]

How do I hide ‘Order Item’ meta?

In order to hide the order item meta from the invoice, simply add the following filter to your themes  functions.php /** * Hide order itemmeta on WooCommerce PDF Invoices’ invoice template. * * @param array $hidden_order_itemmeta itemmeta. * * @return array */ function bewpi_alter_hidden_order_itemmeta( $hidden_order_itemmeta ) { $hidden_order_itemmeta[] = ‘_wc_cog_item_cost’; $hidden_order_itemmeta[] = ‘_wc_cog_item_total_cost’; $hidden_order_itemmeta[] = ‘_subscription_interval’; Read more about How do I hide ‘Order Item’ meta?[…]

How do I display an invoice download button on specific template files?

In order to display an invoice download button, add the below code for example to your “thank you” page or “customer-completed-order” email template. echo do_shortcode( ” ); For use in WordPress editor use below shortcode. This will only work if you replace “ORDER_ID” with an actual order id. Note: Download button will only be displayed when Read more about How do I display an invoice download button on specific template files?[…]

How do I change the more advanced PDF options?

In order to change the more common options for your PDFs, simply add the following action to your themes functions.phpThis filter gives you full control over the mPDF library. Check the mPDF manual for more info. function bewpi_mpdf( $mpdf, $document ) { // change the direction of the invoice to RTL $mpdf->SetDirectionality( ‘rtl’ ); return $mpdf; } add_filter( ‘bewpi_mpdf’, Read more about How do I change the more advanced PDF options?[…]

How do I update a PDF that has already been sent out?

Since version 2.9.4 the plugin removed the ability to update the PDF invoice when it already has been sent to the customer. If in what manner you still want to update the invoice, you can do so by resetting a custom field. Go to the ‘Edit Order’ page. Change custom field ‘bewpi_pdf_invoice_sent’ value within custom field widget Read more about How do I update a PDF that has already been sent out?[…]

How do I add custom fields or meta-data to the PDF invoice templates?

In order to add custom fields or meta-data, use the below code to display meta-data. Replace {META_KEY} with the actual key. If you use another plugin, just ask the key from the author of that plugin. <?php echo WPI()->templater()->get_meta( ‘{META_KEY}’ ); ?><br> Important: A custom template is required to add a custom field to the PDF invoice. Read more about How do I add custom fields or meta-data to the PDF invoice templates?[…]