Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function country_based_tax(){
- // Geolocation must be enabled under Woocommerce > Settings > General > Default customer address
- // IP geolocation
- $location = WC_Geolocation::geolocate_ip();
- //Get country code
- $country = $location['country'];
- // Disable woocommerce_adjust_non_base_location_prices for CH country code
- if($country == 'CH') {
- add_filter( 'woocommerce_adjust_non_base_location_prices', '__return_false' );
- }
- }
- add_action( 'init', 'country_based_tax' );
Add Comment
Please, Sign In to add comment