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?[…]

How do I configure renewal invoicing?

If you are using our premium plugin, you will have the option to automatically create and send invoices for renewal orders, such as subscriptions. First you will have to download the WooCommerce Subscriptions plugin which you can find here. Setting it up Once you’ve acquired both WooCommerce Subscriptions and our premium plugin you can go to Read more about How do I configure renewal invoicing?[…]

How do I add a fee to the invoice?

In order to add a fee to WooCommerce and your invoice, simply add the following action to your themes  functions.php function add_woocommerce_fee() { global $woocommerce; if ( is_admin() && ! defined( ‘DOING_AJAX’ ) ) return; $amount = 5; $woocommerce->cart->add_fee( ‘FEE_NAME’, $amount, true, ‘standard’ ); } add_action( ‘woocommerce_cart_calculate_fees’,’add_woocommerce_fee’ ); Please test the functionality on a development environment of your Read more about How do I add a fee to the invoice?[…]

How do I use a different template based on an order variable?

In order to use a different template based on an order variable, simply add the following filter to your themes functions.php You can, for example, change the function to use a different template based on the payment method instead. /** * Change template based on WPML order language. * Make sure to create custom templates with the correct Read more about How do I use a different template based on an order variable?[…]