• Resolved dspink

    (@dspink)


    After upgrading to latest version we are getting the following on product pages that have variations.

    “There has been a critical error on your website.”

    It breaks the layout of the page.

    Simple products are ok.

    Error log shows….

    [06-Dec-2022 09:35:08 UTC] PHP Fatal error:  Uncaught Error: Call to a member function is_in_stock() on array in /wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php:1375
    Stack trace:
    #0 /wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php(1321): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->has_in_stock_variation(Array)
    #1 /wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php(592): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->product_supports_payment(Object(WC_Product_Variable))
    #2 /wp-includes/class-wp-hook.php(287): WooCommerce\PayPalCommerce\Button\Assets\SmartButton->message_renderer('')
    #3 /wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #4 /wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #5 /home/ira in /wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-button/src/Assets/SmartButton.php on line 1375
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dspink

    (@dspink)

    Fixed this by rolling back

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @dspink,

    Errors like this are often caused by a potential plugin conflict, so it would be good to check if this error persists for you with only the latest PayPal Payments version and WooCommerce being active.
    It doesn’t change anything specifically in this regard, but here is also a pre-release version of the upcoming update available here on GitHub if you’d like to give it a try.
    Thanks!

    Kind regards,
    Niklas

    Plugin Support Syde Niklas

    (@niklasinpsyde)

    I suggest updating to the latest PayPal Payments version 2.0.1 and letting us know if the problem persists for you.
    Since we have not heard back from you in a while, I’m marking this thread as resolved for now. If you have any further questions, please feel free to reopen this topic or create a new one.
    Thanks!

    Kind regards,
    Niklas

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal error on Product page when using Variations’ is closed to new replies.