• Resolved silviotiago

    (@silviotiago)


    Hi,

    we’re getting these errors for over 2 months, and keeps increasing error log with thousands of lines per day.

    I was expecting that an update would fix it, but already 2 came out and still happens.

    All plugins, wordpress and theme are updated.

    We have tried PHP on 8.0, 8.1 and 8.2 and same always happens.

    What do you recommend?

    Error example:

    [16-Dec-2024 17:45:50 UTC] PHP Warning: Undefined variable $orderedby in /home/USER/public_html/wp-content/plugins/woocommerce/templates/loop/result-count.php on line 38
    [16-Dec-2024 17:45:54 UTC] PHP Warning: Undefined variable $orderedby in /home/USER/public_html/wp-content/plugins/woocommerce/templates/loop/result-count.php on line 32
    [16-Dec-2024 17:45:54 UTC] PHP Warning: Undefined variable $orderedby in /home/USER/public_html/wp-content/plugins/woocommerce/templates/loop/result-count.php on line 38
    [16-Dec-2024 17:46:02 UTC] PHP Warning: Undefined variable $orderedby in /home/USER/public_html/wp-content/plugins/woocommerce/templates/loop/result-count.php on line 32
    [16-Dec-2024 17:46:02 UTC] PHP Warning: Undefined variable $orderedby in /home/USER/public_html/wp-content/plugins/woocommerce/templates/loop/result-count.php on line 38
    [16-Dec-2024 17:46:05 UTC] PHP Warning: Undefined variable $orderedby in /home/USER/public_html/wp-content/plugins/woocommerce/templates/loop/result-count.php on line 32
    [16-Dec-2024 17:46:05 UTC] PHP Warning: Undefined variable $orderedby in /home/USER/public_html/wp-content/plugins/woocommerce/templates/loop/result-count.php on line 38

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

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

    I see that your site is displaying a PHP warning—Undefined variable $orderedby in the result-count.php template. This indicates that the $orderedby variable is being used without proper initialization.

    To resolve this, check if your theme or a third-party plugin has overridden the default WooCommerce result-count.php template without correctly initializing the $orderedby variable. You can verify this by navigating to WooCommerce > Status and scrolling to the Templates section.

    Additionally, plugins that modify product queries or sorting options might inadvertently cause this variable to be undefined. To troubleshoot:

    • Deactivate all plugins except for WooCommerce
    • Switch to the default Storefront theme.
    • Remove any custom code running on your site.

    Lastly, ensure that you’re using the latest version of WooCommerce, as updates often include fixes for such issues.

    Let me know if this helps or if you need further assistance! 😊

Viewing 1 replies (of 1 total)

The topic ‘PHP Warning: Undefined variable $orderedby in’ is closed to new replies.