Last active
January 8, 2023 05:41
-
-
Save thetwopct/f658cc66511201b54a3a6010b93ef0ff to your computer and use it in GitHub Desktop.
Deactivate Tax Toggle on some pages / meeting conditions.
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
<?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