This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Apply a different tax rate based on the user role. | |
*/ | |
function wc_diff_rate_for_user( $tax_class, $product ) { | |
$tax_class = 'zero-rate'; | |
// Getting the current user | |
$current_user = wp_get_current_user(); | |
$current_user_data = get_userdata($current_user->ID); | |
if ( is_user_logged_in() && | |
in_array( 'au_export_trade_45', $current_user_data->roles ) || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Apply a different tax rate based on the user role. Updated 2017 | |
*/ | |
function wc_diff_rate_for_user( $tax_class, $product ) { | |
$user_id = get_current_user_id(); | |
$user_data = get_userdata($user_id); | |
if ( is_user_logged_in() && | |
in_array( 'au_export_trade_45', $user_data->roles ) || | |
in_array( 'row_trade_45', $user_data->roles ) || | |
in_array( 'row_distributor', $user_data->roles ) || |