Skip to content

Instantly share code, notes, and snippets.

@kilbot
Last active October 10, 2017 19:31
Show Gist options
  • Save kilbot/e208d488cf8900ac52c0bb9c9fc0c2ae to your computer and use it in GitHub Desktop.
Save kilbot/e208d488cf8900ac52c0bb9c9fc0c2ae to your computer and use it in GitHub Desktop.
Setting a currency just after login
<?php
// the code below goes in your functions file
function my_custom_pos_template_redirect(){
if ( isset( $_SESSION['wcj-currency'] ) ) {
$_SESSION['wcj-currency'] = 'USD'; // force session variable to correct currency
// unset( $_SESSION['wcj-currency'] ); // or - unset the variable altogether
}
}
add_filter('woocommerce_pos_template_redirect', 'my_custom_pos_template_redirect' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment