Home › Forums › Core › Tax calculation solution not working with new update › Reply To: Tax calculation solution not working with new update
Use below updated code.
add_filter(‘woo_wallet_form_cart_cashback_amount’, ‘woo_wallet_form_cart_cashback_amount_callback’, 10);
function woo_wallet_form_cart_cashback_amount_callback($cashback_amount) {
$global_cashbak_type = woo_wallet()->settings_api->get_option(‘cashback_type’, ‘_wallet_settings_credit’, ‘percent’);
$global_cashbak_amount = floatval(woo_wallet()->settings_api->get_option(‘cashback_amount’, ‘_wallet_settings_credit’, 0));
if (‘percent’ === $global_cashbak_type) {
$cashback_amount = (wc()->cart->get_subtotal() + wc()->cart->get_subtotal_tax()) * ($global_cashbak_amount / 100);
}
return $cashback_amount;
}