fbpx /** * Remove tax for specific roles */ function prefix_exclude_tax_by_role() { if( function_exists( 'WC' ) ) { if( isset( WC()->customer ) ) { $role = WC()->customer->get_role(); if( $role == 'customer_ALS' ) { WC()->customer->set_is_vat_exempt( true ); } else { WC()->customer->set_is_vat_exempt( false ); } } } } add_action( 'wp', 'prefix_exclude_tax_by_role' );
  • / Details
  • / Details

Title

Go to Top