Woocommerce - Change the transport class if a field is filled at checkout

Asked

Viewed 73 times

1

I am willing to change the tax class (or zero taxes) of a purchase if a certain field is filled at checkout, which would be the State Registration, if the company or individual has state registration will not pay a certain tax, then it will reset. I tried a few ways and unsuccessfully.

One of the things I tried to do was make a woocommerce_product_tax_class:

$checkout = WC()->checkout();
$billing_ie = $checkout->get_value( 'billing_ie' );

if ($billing_ie == '') {
    $tax_class = 'Zero Rate';
}
else {
    $tax_class = 'ICMS';
}

return $tax_class;

If anyone knows any plugin for new rule of state ICMS Brazil also helps me, because that’s what I’m doing.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.