• Resolved saqibidrees

    (@saqibidrees)


    Hi,

    Installed WooCommerce version 6.8.1. I got fatal errors. When I want to add 1 product add to cart going to add a new product to the cart then I received this error cart/checkout pages crashed.

    Here is the debug information. Can you please verify and tell me what is going wrong?

    [Mon Aug 22 14:48:19.596608 2022] [proxy_fcgi:error] [pid 2171781:tid 140176920225536] [client 12.12.250.66:4752] AH01071: Got error 'PHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/html/pgprint/wp-content/plugins/woocommerce/includes/class-wc-cart.php on line 1425PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to wc_add_number_precision() must be of the type float, null given, called in /var/www/html/pgprint/wp-content/plugins/woocommerce/includes/wc-core-functions.php on line 1946 and defined in /var/www/html/pgprint/wp-content/plugins/woocommerce/includes/wc-core-functions.php:1918\nStack trace:\n#0 /var/www/html/pgprint/wp-content/plugins/woocommerce/includes/wc-core-functions.php(1946): wc_add_number_precision()\n#1 /var/www/html/pgprint/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(344): wc_add_number_precision_deep()\n#2 /var/www/html/pgprint/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(850): WC_Cart_Totals->get_shipping_from_cart()\n#3 /var/www/html/pgprint/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(144): WC_Cart_Totals->calculate_shipping_totals()\n#4 /var/www/html/pgprint/wp-content/plugins/woocommerce/includes/class-wc-cart-totals.php(134): WC_Cart_Totals->calculate()

    • This topic was modified 2 years, 7 months ago by saqibidrees.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter saqibidrees

    (@saqibidrees)

    I just change in WooCommerce core files to make my production work which is not a good solution. I modified file plugins/woocommerce/includes/class-wc-cart-totals.php as follows:

    FROM:
    
                            $shipping_line->total     = wc_add_number_precision_deep( $shipping_object->cost );
                            $shipping_line->taxes     = wc_add_number_precision_deep( $shipping_object->taxes, false );
    TO:
    
                            $shipping_line->total     = wc_add_number_precision_deep( $shipping_object->cost ?? 0.00 );
                            $shipping_line->taxes     = wc_add_number_precision_deep( $shipping_object->taxes ?? 0.00, false );
    • This reply was modified 2 years, 7 months ago by saqibidrees.
    Plugin Support Shevene L. a11n

    (@envesh)

    Hi @saqibidrees,

    This is a known bug that has been reported to our developers. You can follow it here: https://github.com/woocommerce/woocommerce/issues/33950.

    The workaround for now is to downgrade WooCommerce to the previous stable version, 6.6.1. To do that, please follow the steps below:

    Would you mind giving that a try and letting us know if you encounter any issues?

    Thanks!

    Thread Starter saqibidrees

    (@saqibidrees)

    @envesh thanks for your reply. I downgrade the version it’s currently working fine. but when it is completed by your developer please let me know.

    Plugin Support Shevene L. a11n

    (@envesh)

    Hi @saqibidrees,

    Ah, perfect, thank you for letting us know! ??

    The best way to track the issue would definitely be by using the GitHub link shared earlier. On the left-hand side, you will see the option to subscribe for notifications.

    I’ll go ahead and mark this thread as resolved for now.

    Have a lovely day and stay safe!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal error: Uncaught TypeError:’ is closed to new replies.