Reply To: Tax calculation solution not working with new update2019-05-28T23:30:23+05:30

Home Forums Core Tax calculation solution not working with new update Reply To: Tax calculation solution not working with new update

Subrata Mal
Keymaster
Post count: 175

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;
}