Open tyrann0us opened 4 years ago
@kasparsd, any change you take a look at this? Thanks!
@kopepasah, any chance this issue can be fixed? Thanks!
@kasparsd, the bug still occurs with the following system information:
v3.8.2
v6.2.1
v4.0.2
v5.9.1
I'd really appreciate it if you could have a look since it's massively spamming our logs. It should be possible to provide you with a copy of "WooCommerce Subscriptions" for testing purposes if need be. Thank you!
Hi @kasparsd, this is my semi-annual friendly reminder to ask if you could take a look at this issue. Thanks 🙂
Bug Report
If the following plugins are active: Stream, WooCommerce and WooCommerce Subscriptions (https://woocommerce.com/products/woocommerce-subscriptions/) and a callback for the
woocommerce_available_payment_gateways
filter hook uses\WC_Cart->get_cart()
, a PHP notice is triggered.Expected Behavior
No PHP notice(s) should be triggered.
Actual Behavior
A PHP notice is triggered:
Notice: Get cart should not be called before the wp_loaded action.
Stack trace (with some comments):
Steps to Reproduce the Problem
woocommerce_available_payment_gateways
filter hook\WC()->cart->get_cart()
Calling
\WC_Cart::get_cart()
is a common practice to toggle payment providers based on cart content.System Information
v3.5.0
v4.3.1
v3.0.4
v5.4.2