You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering a PHP notice related to the get_cart function in WooCommerce on every page visit of the production website. The notice indicates that get_cart is being called incorrectly, as it should not be called before the wp_loaded action. This issue seems related to the WooCommerce PayPal Payments plugin.
Error message: [12-Sep-2024 11:12:08 UTC] PHP Notice: Die Funktion get_cart wurde <strong>fehlerhaft</strong> aufgerufen. „Get cart“ sollte nicht vor der Action „wp_loaded“ aufgerufen werden. Backtrace: require_once('wp-load.php'), require_once('/var/www/.../wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry->initialize, do_action('woocommerce_blocks_payment_method_type_registration'), WP_Hook->do_action, WP_Hook->apply_filters, WooCommerce\PayPalCommerce\Blocks\BlocksModule->WooCommerce\PayPalCommerce\Blocks\{closure}, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->get, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->getCached, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->invokeGenerator, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->WooCommerce\PayPalCommerce\Vendor\Dhii\Container\{closure}, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CompositeContainer->get, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer->get, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer->invokeFactory, WooCommerce\PayPalCommerce\Blocks\BlocksModule::WooCommerce\PayPalCommerce\Blocks\{closure}, WC_Cart->needs_shipping, apply_filters('woocommerce_cart_needs_shipping'), WP_Hook->apply_filters, ek_filter_cart_needs_shipping, WC_Cart->get_cart, WC_Cart_Session->get_cart_from_session, WC_Cart->calculate_totals, WC_Cart_Session->set_session, WC_Cart_Session->get_cart_for_session, WC_Cart->get_cart, wc_doing_it_wrong Weitere Informationen: <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress (engl.)</a>. (Diese Meldung wurde in Version 2.3 hinzugefügt.) in /var/www/.../htdocs/wp-includes/functions.php on line 6085
To Reproduce
Visit any page on the production website.
Check the PHP error logs.
See the PHP notice related to get_cart.
Expected Behavior
The get_cart function should only be called after the wp_loaded action to avoid PHP notices. No error messages should be logged.
Actual Behavior
A PHP notice is logged on every page visit, indicating that the get_cart function was called too early.
Environment
WordPress Version: 6.6.2
WooCommerce Version: 9.2.3
WooCommerce PayPal Payments Plugin Version: 2.9.0
PHP Version: 8.1.29
Server Environment: nginx/1.26.2
System status
WordPress Environment
WP Version: 6.6.2
WC Version: 9.2.3
WooCommerce PayPal Payments Plugin Version: 2.9.0
PHP Version: 8.1.29
Server Info: nginx/1.26.2
...
<!-- Further details redacted for privacy reasons. -->
The text was updated successfully, but these errors were encountered:
I am encountering a PHP notice related to the
get_cart
function in WooCommerce on every page visit of the production website. The notice indicates thatget_cart
is being called incorrectly, as it should not be called before thewp_loaded
action. This issue seems related to the WooCommerce PayPal Payments plugin.Error message:
[12-Sep-2024 11:12:08 UTC] PHP Notice: Die Funktion get_cart wurde <strong>fehlerhaft</strong> aufgerufen. „Get cart“ sollte nicht vor der Action „wp_loaded“ aufgerufen werden. Backtrace: require_once('wp-load.php'), require_once('/var/www/.../wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry->initialize, do_action('woocommerce_blocks_payment_method_type_registration'), WP_Hook->do_action, WP_Hook->apply_filters, WooCommerce\PayPalCommerce\Blocks\BlocksModule->WooCommerce\PayPalCommerce\Blocks\{closure}, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->get, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->getCached, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->invokeGenerator, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->WooCommerce\PayPalCommerce\Vendor\Dhii\Container\{closure}, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CompositeContainer->get, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer->get, WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer->invokeFactory, WooCommerce\PayPalCommerce\Blocks\BlocksModule::WooCommerce\PayPalCommerce\Blocks\{closure}, WC_Cart->needs_shipping, apply_filters('woocommerce_cart_needs_shipping'), WP_Hook->apply_filters, ek_filter_cart_needs_shipping, WC_Cart->get_cart, WC_Cart_Session->get_cart_from_session, WC_Cart->calculate_totals, WC_Cart_Session->set_session, WC_Cart_Session->get_cart_for_session, WC_Cart->get_cart, wc_doing_it_wrong Weitere Informationen: <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Debugging in WordPress (engl.)</a>. (Diese Meldung wurde in Version 2.3 hinzugefügt.) in /var/www/.../htdocs/wp-includes/functions.php on line 6085
To Reproduce
get_cart
.Expected Behavior
The
get_cart
function should only be called after thewp_loaded
action to avoid PHP notices. No error messages should be logged.Actual Behavior
A PHP notice is logged on every page visit, indicating that the
get_cart
function was called too early.Environment
System status
The text was updated successfully, but these errors were encountered: