Last active
October 10, 2017 19:31
-
-
Save kilbot/e208d488cf8900ac52c0bb9c9fc0c2ae to your computer and use it in GitHub Desktop.
Setting a currency just after login
This file contains hidden or 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 | |
// 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