{"id":408615,"date":"2024-09-23T08:00:00","date_gmt":"2024-09-23T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/tax-switch-for-woocommerce\/"},"modified":"2025-10-25T18:19:00","modified_gmt":"2025-10-25T18:19:00","slug":"tax-switch-for-woocommerce","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/tax-switch-for-woocommerce\/","title":{"rendered":"Tax Switch for WooCommerce"},"content":{"rendered":"<p>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.<\/p>\n<h3>Key features<\/h3>\n<ul>\n<li>Display customizable switches where you want<\/li>\n<li>Gutenberg block support<\/li>\n<li>Shortcode for easy integration (including shortcode generator)<\/li>\n<li>Flexible display options for prices with and without VAT<\/li>\n<li>Remembers the user\u2019s preference for future visits<\/li>\n<li>Choose between a toggle switch or buttons<\/li>\n<\/ul>\n<p>For more information about this plugin, please visit the <a href=\"https:\/\/products.wijnberg.dev\/product\/wordpress\/plugins\/tax-switch-for-woocommerce\/\" rel=\"nofollow ugc\">plugin page<\/a>.<\/p>\n<h3>Requirements<\/h3>\n<ul>\n<li>WooCommerce plugin installed and activated<\/li>\n<li>WooCommerce tax calculations enabled and configured<\/li>\n<\/ul>\n<h3>Configuration<\/h3>\n<p>Configure the plugin settings below for proper functionality.<\/p>\n<h4>WooCommerce settings<\/h4>\n<p>Ensure these WooCommerce settings are configured first:<\/p>\n<ol>\n<li>\n<p><strong>Configure tax calculations<\/strong><\/p>\n<ul>\n<li>Go to: <em>WooCommerce > Settings > General<\/em><\/li>\n<li>Verify your shop address is complete<\/li>\n<li>Enable <em>\u201cEnable tax rates and calculations\u201d<\/em><\/li>\n<li>Set <em>\u201cDefault customer location\u201d<\/em> to <em>\u201cShop base address\u201d<\/em><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Set up tax rates<\/strong><\/p>\n<ul>\n<li>Go to: <em>WooCommerce > Settings > Tax > Standard Rates<\/em><\/li>\n<li>Add your regional tax rates<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Recommended: tax calculation method<\/strong><\/p>\n<ul>\n<li>Go to: <em>WooCommerce > Settings > Tax<\/em><\/li>\n<li>Set <em>\u201cCalculate tax based on\u201d<\/em> to <em>\u201cShop base address\u201d<\/em><br \/>\n<em>(This provides instant tax calculation. Other methods require customers to enter their address first.)<\/em><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Individual product configuration<\/strong><\/p>\n<ul>\n<li>Edit products at: <em>Products > [Product]<\/em><\/li>\n<li>Under <em>Product Data > Tax<\/em>, set status to <em>\u201cTaxable\u201d<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h4>Plugin settings<\/h4>\n<p>Configure these plugin-specific settings:<\/p>\n<ol>\n<li><strong>Main settings<\/strong>\n<ul>\n<li>Go to: <em>WooCommerce > Settings > Tax Switch<\/em><\/li>\n<li>Set your preferred text values<\/li>\n<li>Optional: Restrict display locations<\/li>\n<li>Optional: Generate a shortcode via <em>WooCommerce > Settings > Tax Switch > Shortcode<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>Usage<\/h3>\n<p>After installation and configuration, you can add the tax switch to your pages in two ways:<\/p>\n<ol>\n<li>Use the Gutenberg block \u201cTax Switch for WooCommerce\u201d in your page or post editor.<\/li>\n<li>Use the shortcode <code>[wdevs_tax_switch]<\/code> anywhere in your content.<\/li>\n<\/ol>\n<h4>Shortcode Usage<\/h4>\n<p><strong>Switch\/buttons<\/strong><\/p>\n<p>Basic usage:<br \/>\n[wdevs_tax_switch]<\/p>\n<p>Displays a switch to toggle displaying prices including or excluding VAT.<\/p>\n<p>The shortcode accepts several attributes to customize its appearance and behavior:<\/p>\n<ul>\n<li><code>class-name<\/code>: Adds custom CSS classes to the switch.\n<ul>\n<li>Default: is-style-default<\/li>\n<li>Options: is-style-default, is-style-inline, or custom classes<\/li>\n<\/ul>\n<\/li>\n<li><code>switch-type<\/code>: Determines the style of the toggle.\n<ul>\n<li>Default: <code>switch<\/code><\/li>\n<li>Options: <code>switch<\/code>, <code>buttons<\/code><\/li>\n<\/ul>\n<\/li>\n<li><code>switch-color<\/code>: Sets the color of the switch handle.<\/li>\n<li><code>switch-color-checked<\/code>: Sets the color of the switch when it\u2019s in the \u201con\u201d position.<\/li>\n<li><code>switch-background-color<\/code>: Sets the background color of the switch.<\/li>\n<li><code>switch-text-color<\/code>: Sets the text color of the switch labels.<\/li>\n<li><code>switch-background-color-checked<\/code>: Sets the background color of the switch when it\u2019s in the \u201con\u201d position.<\/li>\n<li><code>switch-label-incl<\/code>: Sets the text for the \u201cincluding VAT\u201d label.\n<ul>\n<li>Default: Uses the text set in the plugin settings or \u201cIncl. VAT\u201d if not set.<\/li>\n<\/ul>\n<\/li>\n<li><code>switch-label-excl<\/code>: Sets the text for the \u201cexcluding VAT\u201d label.\n<ul>\n<li>Default: Uses the text set in the plugin settings or \u201cExcl. VAT\u201d if not set.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Example with custom attributes:<\/p>\n<pre><code>[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\"]\n<\/code><\/pre>\n<p><strong>Label<\/strong><\/p>\n<p>Basic usage:<br \/>\n[wdevs_tax_switch_label]<\/p>\n<p>Displays text indicating the currently selected tax setting. The text updates automatically when the tax switch is toggled.<\/p>\n<p>The shortcode accepts several attributes to customize its appearance and behavior:<\/p>\n<ul>\n<li><code>class-name<\/code>: Adds custom CSS classes to the label.\n<ul>\n<li>Default: is-style-default<\/li>\n<li>Options: is-style-default or custom classes<\/li>\n<\/ul>\n<\/li>\n<li><code>label-text-incl<\/code>: Sets the text to display when \u201cincluding VAT\u201d is selected.\n<ul>\n<li>Default: Uses the text set in the plugin settings or \u201cIncl. VAT\u201d if not set.<\/li>\n<\/ul>\n<\/li>\n<li><code>label-text-excl<\/code>: Sets the text to display when \u201cexcluding VAT\u201d is selected.\n<ul>\n<li>Default: Uses the text set in the plugin settings or \u201cExcl. VAT\u201d if not set.<\/li>\n<\/ul>\n<\/li>\n<li><code>label-text-color<\/code>: Sets the \u201cexcluding VAT\u201d text color.<\/li>\n<li><code>label-text-color-checked<\/code>: Sets the \u201cincluding VAT\u201d text color.<\/li>\n<\/ul>\n<p>Example with custom attributes:<\/p>\n<pre><code>[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\"]\n<\/code><\/pre>\n<h4>PHP implementation<\/h4>\n<p>You can use these shortcodes with PHP with the do_shortcode() function:<\/p>\n<pre><code><?php echo do_shortcode('[wdevs_tax_switch]'); ?>\n<?php echo do_shortcode('[wdevs_tax_switch_label]'); ?>\n<\/code><\/pre>\n<h4>JavaScript events<\/h4>\n<p>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.<\/p>\n<pre><code>document.addEventListener('wdevs-tax-switch-changed', function(event) {\n   console.log(event.detail);\n   \/\/ event.detail contains:\n   \/\/ - isSwitched: boolean - the raw switch state\n   \/\/ - displayIncludingVat: boolean - whether prices now display including VAT\n });\n<\/code><\/pre>\n<p>If you are loading the switch dynamically (via AJAX), dispatch this event after rendering to initialize the component:<\/p>\n<pre><code>   document.dispatchEvent( new CustomEvent('wdevs-tax-switch-appeared') );\n<\/code><\/pre>\n<h3>WPML<\/h3>\n<p>To translate the option texts via WPML:<\/p>\n<ol>\n<li>Save your options first in: WooCommerce -> Settings -> Tax Switch<\/li>\n<li>Then translate the texts in: WPML -> String Translations and search for your option values in the domain \u2018tax-switch-for-woocommerce\u2019<\/li>\n<\/ol>\n<h3>Compatibility<\/h3>\n<p>This plugin integrates with WooCommerce\u2019s 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.<\/p>\n<p>The following themes have been tested and confirmed compatible:<\/p>\n<ul>\n<li>GeneratePress<\/li>\n<li>Blocksy<\/li>\n<li>Thrive<\/li>\n<li>Flatsome<\/li>\n<li>Kapee<\/li>\n<li>Entr<\/li>\n<li>Woodmart<\/li>\n<\/ul>\n<p>The following plugins have been tested and confirmed compatible:<\/p>\n<ul>\n<li>WooCommerce Product Table Lite (+ PRO)<\/li>\n<li>Tiered Pricing Table for WooCommerce (+ Premium)<\/li>\n<li>Measurement Price Calculator for WooCommerce<\/li>\n<li>Discount Rules for WooCommerce<\/li>\n<li>YITH WooCommerce Product Add-Ons (+ & Extra Options Premium)<\/li>\n<li>JetEngine Listing Grid (Elementor)<\/li>\n<li>Product Add-Ons for WooCommerce<\/li>\n<li>B2BKing \u2013 Ultimate WooCommerce Wholesale and B2B Solution (+ Premium)<\/li>\n<li>Advanced Product Fields Pro for WooCommerce<\/li>\n<li>WooCommerce Quantity Discounts, Rules & Swatches<\/li>\n<li>FacetWP<\/li>\n<li>Variation Swatches for WooCommerce (+ PRO)<\/li>\n<li>Variation Price Display Range for WooCommerce (+ PRO)<\/li>\n<li>WooCommerce Product Add-Ons Ultimate<\/li>\n<li>Advanced Woo Search (+ PRO)<\/li>\n<li>B2B Market<\/li>\n<li>FiboFilters<\/li>\n<li>Extra Product Options & Add-Ons for WooCommerce<\/li>\n<li>FiboSearch \u2013 Ajax Search for WooCommerce (+ Pro)<\/li>\n<\/ul>\n<p>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.<\/p>\n<h3>Incompatibility<\/h3>\n<p>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:<\/p>\n<ul>\n<li>Unlimited Elements for Elementor (+ Pro): AJAX pagination and filtering issues<\/li>\n<li>Barn2: WooCommerce Product Options<\/li>\n<\/ul>\n<h3>Additional Information<\/h3>\n<p>This plugin is fully open source. You can find the source code on <a href=\"https:\/\/github.com\/Paulsky\/tax-switch\" rel=\"nofollow ugc\">GitHub<\/a><\/p>\n<p>For more information and other WordPress plugins, visit <a href=\"https:\/\/products.wijnberg.dev\/product-category\/wordpress\/plugins\/\" rel=\"nofollow ugc\">Wijnberg Developments<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let customers toggle between inclusive and exclusive VAT pricing in your WooCommerce store.<\/p>\n","protected":false},"author":65,"featured_media":408616,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Tax Switch for WooCommerce - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"Let customers toggle between inclusive and exclusive VAT pricing in your WooCommerce store."},"footnotes":""},"categories":[1],"tags":[2301,1237,42],"class_list":["post-408615","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-tax","tag-vat","tag-woocommerce"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/408615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=408615"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/408615\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/408616"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=408615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=408615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=408615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}