Skip to content

Commit

Permalink
fix currency check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidsector9 committed Feb 27, 2024
1 parent c7c9967 commit dcc5b83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/class-wc-gateway-payfast.php
Original file line number Diff line number Diff line change
Expand Up @@ -1829,10 +1829,10 @@ public function filter_currency( $currency ) {
$currency_code = WC()->session->get( \WCPay\MultiCurrency\MultiCurrency::CURRENCY_SESSION_KEY );
// Check if the currency is set in the user meta (for logged-in users).
} elseif ( $user_id ) {
$currency_code = get_user_meta( $user_id, \WCPay\MultiCurrency\MultiCurrency::CURRENCY_META_KEY );
$currency_code = get_user_meta( $user_id, \WCPay\MultiCurrency\MultiCurrency::CURRENCY_META_KEY, true );
}

if ( is_array( $currency_code ) && in_array( 'ZAR', $currency_code, true ) ) {
if ( is_string( $currency_code ) && 'ZAR' === $currency_code ) {
return 'ZAR';
}

Expand Down

0 comments on commit dcc5b83

Please sign in to comment.