• Add-ons
  • Blog
  • Resources
    • Documentation
    • FAQs
    • Code snippets
    • Use cases
    • Support
  • Account
    • My account
    • Checkout
    • Cart
  • English
  • French
  • Add-ons
  • Blog
  • Resources
    • Documentation
    • FAQs
    • Code snippets
    • Use cases
    • Support
  • Account
    • My account
    • Checkout
    • Cart
  • English
  • French
home/Knowledge Base/Code snippets/Adding predefined tax rates to the invoicing add-on

Adding predefined tax rates to the invoicing add-on

75 views 0 April 13, 2021 June 10, 2021

The invoicing add-on allows you to quickly select predefined tax rates. By default, only a single rate is included to remove all taxes. You may want to add your own rates in order to avoid typing them each time. Here is a snippet to add to your theme’s functions.php file to add 2 predefined rates for VAT:

function cuar_add_my_predefined_tax_rates($rates)
{
    return array_merge($rates, [
        [
            'label' => __('VAT - standard rate', 'my-text-domain'),
            'rate'  => 20
        ],
        [
            'label' => __('VAT - reduced rate', 'my-text-domain'),
            'rate'  => 10
        ],
    ]);
}
add_filter('cuar/private-content/invoices/predefined-tax-rates', 'cuar_add_my_predefined_tax_rates');
Tags:invoicing

Was this helpful?

Yes  No
Related Articles
  • Custom admin notification’s recipients
  • Disable CSS resets and allow integration of third party plugins
  • Automatically add a user to a group
  • Changing the default page shown by the Customer Area
  • Changing the page shown after logout
  • Sidebars: how to disable them
Knowledge base
  • Code snippets 25
  • Use cases 2
  • Community links 5
FAQ
  • About licences 7
  • Pre-sales questions 3
  • After-sales questions 1
  • Plugin usage 8
  • Technical questions 10
  • Payments 4
Documentations
  • Getting started
  • Using code snippets
  • The template system
  • Full documentation
Support
  • Pre-sales Enquiries
  • Main plugin support
  • Premium add-ons support
  • Feature Requests
  • Terms and conditions for sales
  • Refund policy
  • Privacy Policy
  • Legal notices
  • Copyright 2021 wp-customerarea.com. All Rights Reserved.