0

We've got a custom user role called "Trade Customer."

For normal customers, the price is set in the system as INCLUDING tax - so £59.99 is the price including tax. For Trade Customers, the price is imported from an external system and for example would be £15.00 and that's NOT INCLUDING tax.

Under WooCommerce > Settings > Tax we've got the Prices entered with tax option set to Yes, I will enter prices inclusive of tax.

The tax band is 20%.

So when a customer buys the £59.99 item at the cart it shows £47.99 + £12 TAX.

With a trade customer, we want this to work the other way round, so the price in the store is £15.00, then when they get to the checkout it shows £15.00 + £3 TAX for a total of £18.

We've tried the following code to change the tax to show at the cart for Trade Users:

// Change tax setting for trade
function s9_override_tax_settings_trade( $value ) {
    if ( s9_has_user_role('trade_customer') ) {
        return 'excl';
    }
    return $value;
}

add_filter( 'pre_option_woocommerce_tax_display_shop', 's9_override_tax_settings_trade' );
add_filter( 'pre_option_woocommerce_tax_display_cart', 's9_override_tax_settings_trade' );

The problem is, this only inverts the price so instead of showing £15.00 + £3 VAT, it shows £12.00 + £3 VAT when we want it to show £15.00 + £3 VAT.

We effectively need to override the Prices entered with tax option of Yes, I will enter prices inclusive of tax to No, I will enter prices exclusive of tax but only for trade customers but I can't seem to find a filter for this.

Any ideas on how this can be achieved?

0 Answers0