• Resolved Larry Daniele

    (@larrydaniele)


    Has the WPC Product Bundles for WooCommerce v6.3.3 plugin been tested with PHP 8?

    I have an up-to-date WordPress site that I’ve upgraded to PHP 8.1 and now we’re seeing some strange WooCommerce order problems but only when there is a BUNDLE in the cart.

    When a user places an order with a bundle and pays with PayPal, the PayPal part goes fine, but when they return to our website, the order is not marked as paid, the item is still in the cart, and this error message is in the middle of the page:

    SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

    And when we tried to mark a “Paid by Check” order with a bundle in it as “Completed” in the WooCommerce backend, we get a white screen with the text:

    TypeError thrown
    Unsupported operand types: int + string

    Neither of these problems occur if we use PHP 8.1 and non-bundle product. Neither of these problems occur if we use PHP 7.4 and a bundle product. So it seems that bundles with PHP 8.1 are the problem.

    If I can provide any more details, please let me know, but I didn’t find anything obvious in error_log or debug.log. Thanks in advance for your help (and a wonderful plugin)!

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Larry Daniele

    (@larrydaniele)

    Today, I tried to reproduce this problem under a number of scenarios.

    I am able to see this “SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data” message even with the “WPC Product Bundles for WooCommerce” plugin deactivated. So it is off the “primary suspects” list for now. 🙂

    If I find the source of the problem, I will report it here.

    Thread Starter Larry Daniele

    (@larrydaniele)

    The problem was in a private plugin that was handling the ‘profile_update’ event and refreshing the current page. This caused HTML to be returned instead the expected JSON on a WooCommerce checkout AJAX call. So case closed and NOT a “WPC Product Bundles for WooCommerce” problem.

    Thread Starter Larry Daniele

    (@larrydaniele)

    Marking this as “Resolved”.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problems with PHP 8: “TypeError thrown” and “SyntaxError: JSON.parse”’ is closed to new replies.