Public Ticket #3048244

VAT in order details

Closed
Comments
7 Tickets 2
depaolisdaniele1990 started the conversation 4 years ago on May 20, 2022 at 6:26pm

I want to know if theres a way to show VAT = 0 in order details only to B2B users, i could even use a snippet for it, i just want to know how its done so i dont mess up the pluggin coding.

2,762
KingsPlugins replied 4 years ago on May 21, 2022 at 11:39am

Hi there,

The only way would be that the order or user is tax exempt when the order is first placed. I don't have a way to modify it afterwards -  that would interfere with WooCommerce's inner workings.

7 Tickets 2
depaolisdaniele1990 replied 4 years ago on May 23, 2022 at 1:59pm

Yes I am using tax exemption rules, it appears in cart VAT = 0, but in the invoice sent to the customer the Vat doesnt appear, is there a way with b2bkin that in the invoice the VAT is shown as VAT = 0 ? as i said before, i could use a snippet.

7 Tickets 2
depaolisdaniele1990 replied 4 years ago on May 24, 2022 at 4:06pm

for instance i want to use this snippet to show vat = 0 in order:

add_filter( 'woocommerce_order_hide_zero_taxes', '__return_false' );

But i only want it to work on B2B users, so if you would please let me know what is the snippet for this to apply ONLY to B2B users I would appreciate :)

2,762
KingsPlugins replied 4 years ago on May 25, 2022 at 1:56pm

To make that snippet apply to only B2B users, you can write it as follows:

$user_id = get_current_user_id();
$is_b2b = get_user_meta($user_id,'b2bking_b2buser', true);
if ($is_b2b === 'yes'){
    add_filter( 'woocommerce_order_hide_zero_taxes', '__return_false' );
}

(this would only work in the site frontend, not in the site backend / admin panel).

Sign In