Change WooCommerce product price based on category and GEO IP country
WooCommerce has already a Geo IP feature that you can use through WC_Geolocation Class. I have revisited completely your code. To target a product category you can use WordPress has_term() function on WooCommerce Product Category custom taxonomy as follow: function is_geo_country_belgium() { // Get an instance of the WC_Geolocation object class $geolocation_instance = new WC_Geolocation(); … Read more