Skip to content

Instantly share code, notes, and snippets.

@thetwopct
Last active January 8, 2023 05:41
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 thetwopct/f658cc66511201b54a3a6010b93ef0ff to your computer and use it in GitHub Desktop.
Save thetwopct/f658cc66511201b54a3a6010b93ef0ff to your computer and use it in GitHub Desktop.
Deactivate Tax Toggle on some pages / meeting conditions.
<?php
/**
* Remove Tax inc/exc toggle code on some pages.
*
* Based on Tax Toggle for WooCommerce 1.3.6
*
* Plugin: https://1.envato.market/taxtoggle
*/
function woo_tax_toggle_remove_tax_on_some_pages(){
if ( is_admin() ) return;
// you can replace below line with any or multiple conditionals based on WordPress coding standards.
if( is_tax( 'product_cat' ) ){
// Remove default Tax Toggle price manipulation
remove_filter( 'woocommerce_get_price_html', 'wootax_update_price_html', 100, 2 );
}
}
add_action( 'wp', 'woo_tax_toggle_remove_tax_on_some_pages', 999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment