by wijnbergdevelopments on WordPress.org
Let customers toggle between inclusive and exclusive VAT pricing in your WooCommerce store.

This GIF demonstrates the main functionality of the plugin.
Tax Switch for WooCommerce enhances your WooCommerce store by allowing users to toggle between displaying prices including or excluding VAT. This plugin adds a customizable switch component and provides a flexible way to display both price versions.
For more information about this plugin, please visit the plugin page.
Configure the plugin settings below for proper functionality.
Ensure these WooCommerce settings are configured first:
Configure tax calculations
Set up tax rates
Recommended: tax calculation method
Individual product configuration
Configure these plugin-specific settings:
After installation and configuration, you can add the tax switch to your pages in two ways:
[wdevs_tax_switch] anywhere in your content.Switch/buttons
Basic usage:
[wdevs_tax_switch]
Displays a switch to toggle displaying prices including or excluding VAT.
The shortcode accepts several attributes to customize its appearance and behavior:
class-name: Adds custom CSS classes to the switch.
switch-type: Determines the style of the toggle.
switchswitch, buttonsswitch-color: Sets the color of the switch handle.switch-color-checked: Sets the color of the switch when it’s in the “on” position.switch-background-color: Sets the background color of the switch.switch-text-color: Sets the text color of the switch labels.switch-background-color-checked: Sets the background color of the switch when it’s in the “on” position.switch-label-incl: Sets the text for the “including VAT” label.
switch-label-excl: Sets the text for the “excluding VAT” label.
switch-aria-label: Sets the aria label of the switch.
Example with custom attributes:
[wdevs_tax_switch class-name="is-style-inline" switch-type="switch" switch-color="#ffffff" switch-color-checked="#000000" switch-background-color="#000000" switch-background-color-checked="#4CAF50" switch-text-color="#FF0000" switch-label-incl="Incl. tax" switch-label-excl="Excl. tax" switch-aria-label="Switch between prices including and excluding VAT"]
Label
Basic usage:
[wdevs_tax_switch_label]
Displays text indicating the currently selected tax setting. The text updates automatically when the tax switch is toggled.
The shortcode accepts several attributes to customize its appearance and behavior:
class-name: Adds custom CSS classes to the label.
label-text-incl: Sets the text to display when “including VAT” is selected.
label-text-excl: Sets the text to display when “excluding VAT” is selected.
label-text-color: Sets the “excluding VAT” text color.label-text-color-checked: Sets the “including VAT” text color.Example with custom attributes:
[wdevs_tax_switch_label class-name="tax-indicator" label-text-incl="Prices include tax" label-text-excl="Prices exclude tax" label-text-color="#FF0000" label-text-color-checked="#4CAF50"]
You can use these shortcodes with PHP with the do_shortcode() function:
The switch fires a JavaScript event when the tax display is toggled. You can listen for this event to execute custom code when a user switches between inclusive and exclusive VAT display. This is useful for when you need to perform additional actions based on the tax display state.
document.addEventListener('wdevs-tax-switch-changed', function(event) {
console.log(event.detail);
// event.detail contains:
// - isSwitched: boolean - the raw switch state
// - displayIncludingVat: boolean - whether prices now display including VAT
});
If you are loading the switch dynamically (via AJAX), dispatch this event after rendering to initialize the component:
document.dispatchEvent( new CustomEvent('wdevs-tax-switch-appeared') );
To translate the option texts via WPML:
This plugin integrates with WooCommerce’s standard filters and actions for price display and calculation. While most plugins and themes work out of the box, some third-party code use custom price building methods that require specific compatibility integrations.
The following themes have been tested and confirmed compatible:
The following plugins have been tested and confirmed compatible:
If you encounter any compatibility issues with other plugins or themes, please let us know. Your feedback helps us improve the plugin and extend compatibility to more third-party solutions.
After multiple attempts to create compatibility functions, reaching out to the plugin developers several times, and still finding no viable solution, the following plugins remain incompatible:
This plugin is fully open source. You can find the source code on GitHub
For more information and other WordPress plugins, visit Wijnberg Developments.