Tax Toggle - Switch Between Prices Including and Excluding Tax

The [b2bking_tax_toggle] shortcode adds an interactive toggle button that lets visitors switch between viewing prices with or without tax.

When clicked, the toggle instantly updates price displays across your entire store, including shop pages, product pages, category archives, and any other page showing WooCommerce prices. The setting is persistent across the user's session, so they only need to click it once.

How It Works #

This toggle controls the visual display of prices only. It does not alter any actual tax calculations, cart totals, or checkout amounts. What customers pay at checkout is never affected - the toggle is strictly a front-end display preference.

Usage #

Add the shortcode anywhere on your site:

[b2bking_tax_toggle]

We recommend placing the shortcode in your site's header or footer (or another globally visible area) so that visitors can toggle the setting once and have it apply everywhere. Placing it on individual product pages would require users to click it repeatedly, which defeats the purpose of a session-wide toggle.

Important Notes #

Tax-exempt users: The toggle has no effect for B2B users who are tax-exempt (i.e., users with a "Pay tax in cart: No" tax exemption rule). Since these users have no tax applied to their prices, there is nothing for the toggle to add or remove. For these users, the toggle will have no visible impact.

This tax toggle should generally not be used alongside B2BKing's tax exemption dynamic rules. Combining the two may lead to conflicting or confusing price displays. As an alternative solution, you can also consider showing this tax toggle only for specific user categories such as logged out users.

Combining with Visibility Shortcodes #

You can control who sees the toggle by wrapping it with B2BKing's content visibility shortcodes.

Example: Show the toggle only to logged-out users:

[b2bking_content show_to="loggedout"][b2bking_tax_toggle][/b2bking_content]

This way you could have a configuration where:

  • Logged-out visitors see the toggle and can switch between prices including and excluding tax, helping them explore pricing before creating an account.
  • Logged-in B2B users see only their assigned B2B price (ex. VAT), with no toggle needed.
  • Logged-in B2C users see their standard retail price (inc. VAT), with no toggle needed.

This is just one example - you can combine the toggle with any of B2BKing's content visibility options to match your specific setup and business requirements.

Show Prices Excluding Tax for B2B and Including Tax for B2C #

If your goal is to show prices excluding tax for B2B and including tax for B2C, using this toggle switch is not the recommended approach. Instead, go to B2BKing -> Dynamic rules and configure a Tax Exemption rule for your B2B users, as described at the link above.

Powered by BetterDocs