https://wordpress.org/support/topic/cashback-base-of-price-incl-taxes/
cashback – base of price incl. taxes
Need solution for this for the latest version.
The following code does not work anymore
add_filter(‘woo_wallet_cashback_amount’, ‘woo_wallet_cashback_amount’, 10, 2);
function woo_wallet_cashback_amount($cashback_amount, $order_id) {
if ($order_id) {
return $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;
}