How to change the invoice information meta?

In order to change the invoice information meta from the PDF invoice template, simply use below filter function as an example and add it to your themes functions.php file. /** * Change PDF invoice information meta. * * @param array $info Invoice info meta. * @param BEWPI_Invoice $invoice Invoice object. * * @return array. */ function Read more about How to change the invoice information meta?[…]

How do I create my custom template?

In order to make your custom template, please copy the default template files (including folder) you’ll find in:  plugins/woocommerce-pdf-invoices/includes/templates/invoice/simple to uploads/woocommerce-pdf-invoices/templates/invoice/simple  The plugin will automatically detect the template and make it available for selection within the Template Settings. Now you should be able to start making changes to your files.  Important: Before you update the plugin, always Read more about How do I create my custom template?[…]

How do I allow a specific role to download invoices?

In order to allow a specific role to download invoices, simply add the following action to your themes  functions.php function bewpi_allowed_roles_to_download_invoice($allowed_roles) { // available roles: shop_manager, customer, contributor, author, editor, administrator $allowed_roles[] = “editor”; // end so on.. return $allowed_roles; } add_filter( ‘bewpi_allowed_roles_to_download_invoice’, ‘bewpi_allowed_roles_to_download_invoice’, 10, 2 ); By default the roles of shop manager and administrators Read more about How do I allow a specific role to download invoices?[…]

How to download the invoice when order has not been paid?

By default the invoice can be downloaded from the account page when the order has been paid for which means that status should be ‘Processing’ or ‘Completed’. If you would like to override this behaviour and show the invoice regardless of the status, use below filters. /** * Always show invoice shortcode button. * * Read more about How to download the invoice when order has not been paid?[…]

How do I alter formatted invoice numbers?

In order to alter formatted invoice numbers, simply add the following filter to your themes  functions.php function alter_formatted_invoice_number( $formatted_invoice_number, $document_type ) { if ( $document_type === ‘invoice/global’ ) { // ‘simple’ or ‘global’. // add M for global invoices. return ‘M’ . $formatted_invoice_number; } return $formatted_invoice_number; } add_filter( ‘bewpi_formatted_invoice_number’, ‘alter_formatted_invoice_number’, 10, 2 ); Please test the Read more about How do I alter formatted invoice numbers?[…]

How do I skip invoice generation altogether?

In order to skip invoice generation completely, simply add the following action to your themes  functions.php function bewpi_skip_invoice_generation( $skip, $status, $order ) { // Do your stuff based on the order. return true; // True to skip. } add_filter( ‘bewpi_skip_invoice_generation’, ‘bewpi_skip_invoice_generation’, 10, 3 ); Please test the functionality on a development environment of your website. If it ceases Read more about How do I skip invoice generation altogether?[…]

How do I skip invoice generation based on a payment method?

In order to skip invoice generation based on a payment method, simply add the following action to your themes  functions.php function bewpi_attach_invoice_excluded_payment_methods( $payment_methods ) { return array( ‘bacs’, ‘cod’, ‘cheque’, ‘paypal’ ); } add_filter( ‘bewpi_attach_invoice_excluded_payment_methods’, ‘bewpi_attach_invoice_excluded_payment_methods’, 10, 2 ); Add the name of the payment method in the return array section. This is the second line. Please test Read more about How do I skip invoice generation based on a payment method?[…]