Skip to content

Commit b553602

Browse files
committed
Use newer property for WCML
Fixes #86
1 parent 1a0686c commit b553602

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

includes/compats/class-wc-amazon-payments-advanced-multi-currency-wpml.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,20 @@ public function __construct() {
4040
* @return string
4141
*/
4242
public function get_selected_currency() {
43-
return ( WC()->session ) ? WC()->session->get( 'client_currency' ) : get_woocommerce_currency();
43+
if ( ! WC()->session ) {
44+
return get_woocommerce_currency();
45+
}
46+
47+
$curr = WC()->session->get( 'wcml_client_currency' );
48+
if ( empty( $curr ) ) {
49+
$curr = WC()->session->get( 'client_currency' );
50+
}
51+
52+
if ( empty( $curr ) ) {
53+
return get_woocommerce_currency();
54+
}
55+
56+
return $curr;
4457
}
4558

4659
/**

0 commit comments

Comments
 (0)