• Resolved Kendall Arneaud

    (@icecappacino)


    I’ve recently had a hardware( hosting from PHP 7 to 8.1) and software update ( theme and woocommerce from 6.xx/8.xx to 9.4.3) and although I can access all areas of the frontend I can explore all areas of the backend except the Products List Page ( I can add edit update but not view list). Errors logs show

    Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in wp-content/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php:475

    Error have a similar pattern and are related to product information, variations etc.

    My Setup is WordPress SSR – Pastebin.com

    I have tried clearing the transients / updating the tables( kept saying its complete and verifying is successful) and regenerating the product attributes( stuck at “Filling 300”) But to no avail. I’m at the point to do a backup but not without trying to export the products which is giving me errors because of it.

    Any advice on how to proceed with solving this problem? I tried going line by line but as fast as I solve one problem another one pops up( similar error “product” related code)

Viewing 1 replies (of 1 total)
  • Hi @icecappacino ,

    Thanks for providing the SSR!

    It seems the error is related to how WooCommerce is handling product data after recent updates, specifically in the class-wc-product-data-store-cpt.php file. The explode() function is expecting a string but is receiving an array, which is likely causing the issue.

    To troubleshoot further, please try the following steps to see if they resolve the issue:

    • Deactivate all plugins except WooCommerce and switch to the default WooCommerce Storefront theme.
    • Temporarily disable any custom attributes created for a product.
    • Regenerate product lookup tables via WooCommerce > Status > Tools.
    • Make sure all plugins are updated to their latest versions and compatible with PHP 8.
    • Clear transients and regenerate them via WooCommerce > Status > Tools.
    • Temporarily downgrade the PHP version to one slightly below 8.0.

    Let us know how it goes or if you need further assistance!

Viewing 1 replies (of 1 total)

The topic ‘Explode Argument Error expected type (string) got (array)’ is closed to new replies.