Skip to content

Instantly share code, notes, and snippets.

@somewherewarm-snippets
Last active November 17, 2021 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somewherewarm-snippets/e663b294c15e4705975006be54b23e50 to your computer and use it in GitHub Desktop.
Save somewherewarm-snippets/e663b294c15e4705975006be54b23e50 to your computer and use it in GitHub Desktop.
Use this snippet to make the Cart Total, Cart Subtotal, Order Total, and Package Total conditions ignore tax.
<?php
/**
* Plugin Name: WooCommerce Conditional Shipping and Payments - Customize conditions to exclude tax.
* Plugin URI: https://woocommerce.com/products/conditional-shipping-and-payments/
* Description: Use this snippet to make the Cart Total, Cart Subtotal, Order Total, and Package Total conditions ignore tax.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Developer: Jason Kytros
*
*
* Copyright: © 2021 Automattic
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
add_filter( 'woocommerce_csp_cart_total_condition_incl_tax', '__return_false' );
add_filter( 'woocommerce_csp_cart_subtotal_condition_incl_tax', '__return_false' );
add_filter( 'woocommerce_csp_package_total_condition_incl_tax', '__return_false' );
add_filter( 'woocommerce_csp_order_total_condition_incl_contents_tax', '__return_false' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment