Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer Multi-Currency fatal if store currency is changed #2068

Closed
jessepearson opened this issue Jun 7, 2021 · 1 comment
Closed

Customer Multi-Currency fatal if store currency is changed #2068

jessepearson opened this issue Jun 7, 2021 · 1 comment
Assignees
Labels
component: customer multi-currency Issues related to customer multi-currency project status: has pr The issue has a PR.

Comments

@jessepearson
Copy link
Contributor

If you go to WooCommerce > Settings > Multi-Currency, and then enable currencies, such as CAD and BIF, then go to Settings > General and change the currency to Euro, it will create a fatal error. This may be due to the enabled currencies array in the database doesn't have the new default currency in it.

In my test I had USD as my store currency, enabled CAD and BIF, then switch to Euro as my store currency and one error stated USD was not an index. I believe this is due to the mock available currencies does not have USD in it, this then causes a downward spiral.

Notice: Undefined index: USD in /Users/j/sites/wcpay/wp-content/plugins/woocommerce-payments/includes/multi-currency/class-multi-currency.php on line 267

Fatal error: Uncaught Error: __clone method called on non-object in /Users/j/sites/wcpay/wp-content/plugins/woocommerce-payments/includes/multi-currency/class-multi-currency.php:267 Stack trace: #0 /Users/j/sites/wcpay/wp-content/plugins/woocommerce-payments/includes/multi-currency/class-multi-currency.php(98): WCPay\Multi_Currency\Multi_Currency->initialize_enabled_currencies() #1 /Users/j/sites/wcpay/wp-content/plugins/woocommerce-payments/includes/multi-currency/class-multi-currency.php(89): WCPay\Multi_Currency\Multi_Currency->init() #2 /Users/j/sites/wcpay/wp-content/plugins/woocommerce-payments/includes/multi-currency/class-multi-currency.php(79): WCPay\Multi_Currency\Multi_Currency->__construct() #3 /Users/j/sites/wcpay/wp-content/plugins/woocommerce-payments/includes/multi-currency/wc-payments-multi-currency.php(21): WCPay\Multi_Currency\Multi_Currency::instance() #4 /Users/j/sites/wcpay/wp-includes/class-wp-hook.php(292): WC_Payments_Multi_Currency('') #5 /Users/j/sites/wcpay/wp-includes/class-wp-hook.php(316): W in /Users/j/sites/wcpay/wp-content/plugins/woocommerce-payments/includes/multi-currency/class-multi-currency.php on line 267

@jessepearson jessepearson added the component: customer multi-currency Issues related to customer multi-currency project label Jun 7, 2021
@jessepearson jessepearson self-assigned this Jun 8, 2021
@jessepearson jessepearson added the status: has pr The issue has a PR. label Jun 8, 2021
@jessepearson
Copy link
Contributor Author

Closed via #2078

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: customer multi-currency Issues related to customer multi-currency project status: has pr The issue has a PR.
Projects
None yet
Development

No branches or pull requests

1 participant