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

Null currency error when the Aelia currency switcher plugin is active (467) #426

Closed
AlexP11223 opened this issue Jan 6, 2022 · 0 comments · Fixed by #427
Closed

Null currency error when the Aelia currency switcher plugin is active (467) #426

AlexP11223 opened this issue Jan 6, 2022 · 0 comments · Fixed by #427
Labels
bug Something isn't working
Milestone

Comments

@AlexP11223
Copy link
Contributor

When the Aelia currency switcher plugin is active and configured, manually creating a WooCommerce order from the backend causes a white page with a fatal error:

PHP Fatal error Uncaught TypeError: Return value of WooCommerce\PayPalCommerce\ApiClient\ApiModule::WooCommerce\PayPalCommerce\ApiClient\{closure}() must be of the type string, null returned in /var/www/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/services.php:325

Stack trace:

#0 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/vendor/dhii/containers/src/DelegatingContainer.php(117): WooCommerce\PayPalCommerce\ApiClient\ApiModule::WooCommerce\PayPalCommerce\ApiClient\{closure}(Object(Dhii\Container\DelegatingContainer))
#1 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/vendor/dhii/containers/src/DelegatingContainer.php(56): Dhii\Container\DelegatingContainer->invokeFactory(Object(Closure))
#2 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/services.php(319): Dhii\Container\DelegatingContainer->get('api.shop.curren...')
#3 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/vendor/dhii/containers/src/DelegatingContainer.php( in /var/www/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-api-client/services.php on line 325

To Reproduce

  1. Install & configure Aelia currency switcher plugin
  2. Create WooCommerce order manually from backend
  3. Page will remain empty and error message is thrown instead of the “edit product page”

Possible cause

Aelia plugin modifies currency using filters and may return null.

Suggested solution

Use get_option('woocommerce_currency').

https://wordpress.org/support/topic/manual-add-order-error/#post-15190717

@AlexP11223 AlexP11223 changed the title Null currency error when the Aelia currency switcher plugin is active Null currency error when the Aelia currency switcher plugin is active (467) Jan 6, 2022
@InpsydeNiklas InpsydeNiklas added the bug Something isn't working label Jan 10, 2022
@Dinamiko Dinamiko added this to the Next Version milestone Jan 11, 2022
@Dinamiko Dinamiko mentioned this issue Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants