Support » Plugin: WooCommerce » array_filter() expects parameter 1 to be array

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Mirko P. woo-hc

    (@rainfallnixfig)

    Hello @joyryde,

    Thanks for sharing this error with us.

    I see you already have an open issue on this forum and we’d like to keep focused and have all the information in one place. For this reason, I’m going to close this topic now and continue troubleshooting your issue here:

    https://wordpress.org/support/topic/newly-uploaded-published-products-do-not-appear-on-front-end/

    * https://wordpress.org/support/guidelines/#do-not-bump-posts

    Thanks for your understanding.

    Thread Starter joyryde

    (@joyryde)

    Two completely different topics and issues. This issue is about customers reporting an error in the cart.

    Plugin Support Mirko P. woo-hc

    (@rainfallnixfig)

    Hi @joyryde,

    Oh, sorry for the confusion 😊 – Let’s take a look at that warning.

    array_filter() expects parameter 1 to be array, string given in wp-content/plugins/woocommerce/includes/class-wc-product-variation.php on line 174

    It looks like some data is being passed to that filter as a string instead of an array. What it doesn’t mention is where that data is coming from. You may be able to see if any error will be logged at WooCommerce > Status > Logs if other customers run into the same warning during their purchase process.

    If you’re not seeing any error logs in the next few days, I would suggest first updating all your software and testing on a staging environment and then enabling debug logging in WordPress to save PHP error logs on the Server.

    Here’s the related documentation for logging errors on the server:

    * https://github.com/woocommerce/woocommerce/wiki/Using-WP_DEBUG_LOG-to-log-errors
    * https://help.dreamhost.com/hc/en-us/articles/360029327771-Enabling-the-WordPress-Debug-log
    * https://woocommerce.com/document/finding-php-error-logs/#section-2

    Hopefully, that will give us more information and we can see what the cause is.

    Cheers.

    Thread Starter joyryde

    (@joyryde)

    Nothing in my logs except normal plugin logs, like order tracking numbers etc.

    Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there!

    This might be a case of deleted attributes or an issue with variations.

    1. Could you edit that product and go to the Attributes and Variations tab to check if everything is set properly?

    2. Could you share your current System Status Report. You can get it by navigating to the WooCommerce / Status section of your site. Once there, click on the Get system report button and then copy it by clicking on the Copy for support button. Then paste it here in a comment.

    Thank you. 🙂

    Thread Starter joyryde

    (@joyryde)

    Hello!

    System status is here:
    https://wordpress.org/support/topic/newly-uploaded-published-products-do-not-appear-on-front-end/page/2/#post-15683633

    Everything on that products variations and attributes is normal, it’s been live on our site with people ordering it for a few months.

    Screenshots:

    https://tinyurl.com/2lvgsoy5

    https://tinyurl.com/2m3x6c3g

    Plugin Support Mirko P. woo-hc

    (@rainfallnixfig)

    Hi there,

    I visited your site, and added a few products to the cart including “Acuva ArrowMax 2.0 12V AC/DC UV LED Water Purifier – Without Smart Faucet” but could not replicate the warning in the screenshot.

    You have a number of plugins enabled on your site, conflicts often occur even if all plugins and themes are up to date, precisely due to clashes between the software codes interacting with each other.

    I would keep an eye on the debug.log file which should be generated from the debugging process and if you’re able to reproduce the warning you could also check the browser console for any other hint on what may be causing it.

    One more suggestion is to raise the PHP Max Input Vars value which is currently at 1000 but appears to be a bit low. You can set it to 3000 or 5000 which are normal values. Here’s an article on how to do it.

    Cheers.

    Thread Starter joyryde

    (@joyryde)

    Thank you @rainfallnixfig you are always so helpful, and I appreciate you!

    The error showed on the final page after the customer paid for the order, not in the cart. The cart was fine, no error there.

    We do our best to have as few plugins as humanly possible, and to use snippets instead, but each one that we have serves an absolutely critical function that we cannot remove, so we are stuck with what we have.

    I have enabled the PHP Max Input Vars to 3000 via wpconfig.php per your suggestion.

    • This reply was modified 4 months ago by joyryde.
    Plugin Support Mashi (woo-hc)

    (@shaonback2)

    Hello @joyryde!

    We do our best to have as few plugins as humanly possible, and to use snippets instead, but each one that we have serves an absolutely critical function that we cannot remove, so we are stuck with what we have.

    I suggest you set up a staging site and do a conflict test by following the steps below…
    You can clone your site to a staging environment and perform tests without modifying your live site or impacting customers. Many hosts provide staging facilities, so it’s worth checking in with them. It’s also possible to do it using the free WP Staging plugin. Link: https://wordpress.org/plugins/wp-staging/

    • Temporarily remove all of your custom code. Please make sure to disable Code Snippet plugin as well.
    • Temporarily switch your theme to Storefront
    • Disable all plugins except for WooCommerce
    • Repeat the action that is causing the problem

    If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each until you find the one causing conflict.
    If the issue comes after activating the Code Snippet plugin then I suggest you deactivate all snippets of the Code Snippet plugin and later activate those one by one.
    You can find a more detailed explanation of how to do a conflict test here. → https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Before you start

    I would suggest installing a plugin called Health Check & Troubleshooting. This is a plugin developed by the WordPress community and it allows you to disable plugins without affecting your current site visitors. Link: https://wordpress.org/plugins/health-check/

    Meks Quick Plugin Disabler is a plugin you can install which will remember what plugins you currently have active so it’s easy to switch them back on. Link: https://wordpress.org/plugins/meks-quick-plugin-disabler/

    Let us know how it goes.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.