al cart. $this->real_cart = WC()->cart; WC()->cart = $this->cart; $this->cart_products->set_cart( $this->cart ); } /** * Restores the real cart. * Currently, unsets the WC cart to prevent race conditions arising from it being persisted. * * @return void */ private function restore_real_cart() { // Remove from cart because some plugins reserve resources internally when adding to cart. $this->remove_cart_items(); if ( apply_filters( 'woocommerce_paypal_payments_simulate_cart_prevent_updates', true ) ) { // Removes shutdown actions to prevent persisting session, transients and save cookies. remove_all_actions( 'shutdown' ); unset( WC()->cart ); } else { // Restores cart, may lead to race conditions. if ( null !== $this->real_cart ) { WC()->cart = $this->real_cart; } } unset( $this->cart ); } }
Fatal error: Uncaught Error: Class "WooCommerce\PayPalCommerce\Button\Endpoint\SimulateCartEndpoint" not found in /htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/ButtonModule.php:132 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/ButtonModule.php(98): WooCommerce\PayPalCommerce\Button\ButtonModule->register_ajax_endpoints(Object(WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer)) #1 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Package.php(530): WooCommerce\PayPalCommerce\Button\ButtonModule->run(Object(WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Container\ReadOnlyContainer)) #2 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Package.php(405): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Package->doExecute() #3 /htdocs/wp-content/plugins/woocommerce-paypal-payments/bootstrap.php(40): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Package->boot() #4 /htdocs/wp-content/plugins/woocommerce-paypal-payments/woocommerce-paypal-payments.php(77): {closure}('/htdocs/wp-cont...') #5 /htdocs/wp-content/plugins/woocommerce-paypal-payments/woocommerce-paypal-payments.php(92): WooCommerce\PayPalCommerce\init() #6 /htdocs/wp-includes/class-wp-hook.php(324): WooCommerce\PayPalCommerce\{closure}('') #7 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #8 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #9 /htdocs/wp-settings.php(555): do_action('plugins_loaded') #10 /htdocs/wp-config.php(93): require_once('/htdocs/wp-sett...') #11 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #12 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #13 /htdocs/index.php(17): require('/htdocs/wp-blog...') #14 {main} Next Exception: Can't obtain the container instance at this point of application. in /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Package.php:701 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Package.php(639): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Package->assertStatus(4, 'obtain the cont...', '>=') #1 /htdocs/wp-content/plugins/woocommerce-paypal-payments/bootstrap.php(42): WooCommerce\PayPalCommerce\Vendor\Inpsyde\Modularity\Package->container() #2 /htdocs/wp-content/plugins/woocommerce-paypal-payments/woocommerce-paypal-payments.php(77): {closure}('/htdocs/wp-cont...') #3 /htdocs/wp-content/plugins/woocommerce-paypal-payments/woocommerce-paypal-payments.php(92): WooCommerce\PayPalCommerce\init() #4 /htdocs/wp-includes/class-wp-hook.php(324): WooCommerce\PayPalCommerce\{closure}('') #5 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #6 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #7 /htdocs/wp-settings.php(555): do_action('plugins_loaded') #8 /htdocs/wp-config.php(93): require_once('/htdocs/wp-sett...') #9 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #10 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #11 /htdocs/index.php(17): require('/htdocs/wp-blog...') #12 {main} thrown in /htdocs/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Inpsyde/Modularity/Package.php on line 701