Enhances WooCommerce 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 WordPress plugins, check out our products at Wijnberg Developments.
- WooCommerce plugin installed and activated
- WordPress 5.0 or higher (for Gutenberg block support)
- WooCommerce tax calculations enabled:
- Go to WooCommerce > Settings > General
- Check the box for "Enable tax rates and calculations"
- Click "Save changes"
- WooCommerce taxes configured:
- Go to WooCommerce > Settings > Tax
- Set up your tax rates and rules as needed for your store
Without proper tax configuration in WooCommerce, the Tax Switch for WooCommerce plugin will not function as intended.
To install the plugin, follow these steps:
- Download the
.zip
file from the releases page. - In your WordPress admin dashboard, go to
Plugins
>Add New
. - Click
Upload Plugin
at the top of the page. - Click
Choose File
, select the.zip
file you downloaded, then clickInstall Now
. - After installation, click
Activate Plugin
.
The plugin is now ready for use.
These instructions will guide you through the installation and basic setup of the Tax Switch for WooCommerce plugin, ensuring a smooth integration with your WooCommerce store.
Once activated, Tax Switch for WooCommerce requires minimal configuration:
- Go to the Tax Switch for WooCommerce settings page located under the 'WooCommerce' menu in the WordPress admin area.
- Customize the text for including and excluding VAT.
- Save your changes.
After configuration, you can add the tax switch to your pages in two ways:
- Use the Gutenberg block "Tax Switch for WooCommerce" in your page or post editor.
- Use the shortcode
[wdevs_tax_switch]
anywhere in your content.
The switch will toggle the display of prices including or excluding VAT across your site.
The plugin provides a shortcode that allows you to easily add the tax switch anywhere on your site.
Basic usage:
[wdevs_tax_switch]
This will display the default tax switch.
The shortcode also accepts several attributes to customize its appearance:
class-name
: Adds custom CSS classes to the switch.- Default:
is-style-default
- Options:
is-style-default
,is-style-inline
, custom classes
- Default:
switch-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-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.- Default: Uses the text set in the plugin settings or "Incl. VAT" if not set.
switch-label-excl
: Sets the text for the "excluding VAT" label.- Default: Uses the text set in the plugin settings or "Excl. VAT" if not set.
Example with custom attributes:
[wdevs_tax_switch class-name="is-style-inline" switch-color="#ffffff" switch-color-checked="#000000" switch-background-color="#000000" switch-background-color-checked="#4CAF50" switch-label-incl="Inc. Tax" switch-label-excl="Ex. Tax"]
This will display an inline-style switch with a white handle that turns black when on, a black background when off, green background when on, and custom labels for including and excluding tax.
You can use this shortcode in posts, pages, and even in your theme files by using the do_shortcode()
function:
<?php echo do_shortcode('[wdevs_tax_switch]'); ?>
This plugin is tested and compatible with the following:
- GeneratePress
- Measurement Price Calculator for WooCommerce
- Tiered Pricing Table for WooCommerce (single product page)
- WooCommerce Product Table
If you encounter any conflicts with other themes or plugins, please report them by opening an issue or through our website.
Some WooCommerce Blocks are not fully compatible with this plugin as they do not use standard WooCommerce filters for price display. This is a known limitation of WooCommerce Blocks and not specific to this plugin. You can fix this by using WooCommerce shortcodes instead of the WooCommerce Blocks.
For more information and updates on this issue, please refer to the following GitHub issue: WooCommerce Blocks Issue #8972
We are monitoring this issue and will update the plugin accordingly when a solution becomes available. In the meantime, the tax switch functionality may not work as expected with certain WooCommerce Blocks.
Currently supported languages:
- English
- Dutch (Nederlands)
If you would like to add support for a new language or improve existing translations, please let us know by opening an issue or contacting us through our website.
Your contributions are welcome! If you'd like to contribute to the project, feel free to fork the repository, make your changes, and submit a pull request.
To prepare your development work for submission, ensure you have npm
installed and run npm run build
. This command compiles the React components and prepares the plugin for deployment.
- Ensure
npm
is installed. - Navigate to the project root.
- Run
npm run build
.
The compiled files are now ready for use. Please ensure your changes adhere to the project's coding standards.
If you discover any security related issues, please email us instead of using the issue tracker.
This plugin is licensed under the GNU General Public License v2 or later.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.