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

type error on cart total check with get_cart_contents_total() on null (635) #603

Closed
Narek13 opened this issue Apr 14, 2022 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@Narek13
Copy link
Collaborator

Narek13 commented Apr 14, 2022

Describe the Bug

There are multiple errors reported:

2022-04-07T09:18:27+00:00 CRITICAL Uncaught Error: Call to a member function get_cart_contents_total() on null in /chroot/home/a4084adf/wealthyhair.com/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php:1127
Stack trace:
#0 /chroot/home/a4084adf/wealthyhair.com/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php(378): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->is_cart_price_total_zero()
#1 /chroot/home/a4084adf/wealthyhair.com/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php(195): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->render_button_wrapper_registrar()
#2 /chroot/home/a4084adf/wealthyhair.com/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/ButtonModule.php(56): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->render_wrapper()
#3 /chroot/home/a4084adf/wealthyhair.com/html/wp-includes/class-wp-hook.php(307): WooCommerce\PayPalCommerce\Button\But in /chroot/home/a4084adf/wealthyhair.com/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php on line 1127

Seems like there can be multiple causes for the same error.

To Reproduce

not quite sure how to reproduce but there are multiple reports.

@Narek13 Narek13 added the bug Something isn't working label Apr 14, 2022
@braddalton
Copy link

Still getting this error and cannot accept PayPal credit cards on front end.

2022-05-15T17:44:18+00:00 CRITICAL Uncaught Error: Call to a member function get_cart_contents_total() on null in /nas/content/live/wpsites/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php:1227
Stack trace:
#0 /nas/content/live/wpsites/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php(448): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->is_cart_price_total_zero()
#1 /nas/content/live/wpsites/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php(229): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->render_button_wrapper_registrar()
#2 /nas/content/live/wpsites/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/ButtonModule.php(57): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->render_wrapper()
#3 /nas/content/live/wpsites/wp-includes/class-wp-hook.php(307): WooCommerce\PayPalCommerce\Button\ButtonModule::WooCommerce\PayPalCommerce\Button{closure}(Object(WP))
#4 /nas/content/li in /nas/content/live/wpsites/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php on line 1227

@InpsydeNiklas
Copy link
Member

@braddalton The fix linked in this PR will not be implemented as the error has been addressed in #606 which will be included in the next 1.9.0 update. The fix in this PR prevents the error and is an easy change to apply, but version 1.7.0 or this package with the actual fix applied could also be used to prevent the error.

@braddalton
Copy link

1.7 doesn't work for me. Same error. It displays the popup and shows the credit card fields for 1 second but then closes and shows an error. Logs are the same as i previously published.

v.mov

@InpsydeNiklas
Copy link
Member

@braddalton The error from this issue is unrelated to this message in the popup window from your video. What happens in this window is usually outside of the scope of the plugin. Have you given it a try with a PayPal sandbox account connected to rule out an issue with the merchant account?
If any doubts remain, please open a support request from here: https://paypal.inpsyde.com/docs/request-support/
Thanks!

@fliespl
Copy link

fliespl commented May 18, 2022

This issue is still valid in wordpress API:
i.e. /xxxx/wp-json/wp/v2/users/

ends up with:

https://ss.codeone.pl/ss-2022-05-18-21-52-11-1652903531-ggeDyjnk.png

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.

4 participants