Created
June 8, 2020 17:29
-
-
Save pablo-sg-pacheco/8c6c63a74e2c395e7ae479c1df27c3e2 to your computer and use it in GitHub Desktop.
Booster for WooCommerce - Get info from Prices and Currencies by Country Module Options
This file contains 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 | |
add_action('wp_footer',function(){ | |
if ( !WCJ()->modules['price_by_country']->is_enabled() ) { | |
return; | |
} | |
$country = WCJ()->modules['price_by_country']->core->get_customer_country_by_ip(); | |
$group = WCJ()->modules['price_by_country']->core->get_customer_country_group_id(); | |
$the_result = array('country'=>$country,'group'=>$group); | |
?> | |
<script> | |
let result = <?php echo wp_json_encode($the_result); ?>; | |
console.log(result); | |
</script> | |
<?php | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment