Created
January 8, 2025 03:32
-
-
Save shameemreza/499578097e9755cfffc480130d27b9a3 to your computer and use it in GitHub Desktop.
Modify the tax behavior for deposits
This file contains hidden or 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
add_filter('woocommerce_calculated_total', 'exclude_tax_from_deposits', 10, 2); | |
function exclude_tax_from_deposits($total, $cart) { | |
if (class_exists('WC_Deposits_Cart_Manager') && WC_Deposits_Cart_Manager::is_deposit_enabled_for_cart()) { | |
$total -= WC()->cart->get_taxes_total(); // Exclude taxes from deposit | |
} | |
return $total; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment