Skip to content

Instantly share code, notes, and snippets.

@pablo-sg-pacheco
Created June 8, 2020 17:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pablo-sg-pacheco/8c6c63a74e2c395e7ae479c1df27c3e2 to your computer and use it in GitHub Desktop.
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
<?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