Skip to content

Instantly share code, notes, and snippets.

@shameemreza
Created January 8, 2025 03:32
Show Gist options
  • Save shameemreza/499578097e9755cfffc480130d27b9a3 to your computer and use it in GitHub Desktop.
Save shameemreza/499578097e9755cfffc480130d27b9a3 to your computer and use it in GitHub Desktop.
Modify the tax behavior for deposits
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