Home Forums WoodMart support forum PHP Warning that is null creates an empty shop

PHP Warning that is null creates an empty shop

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #612912

    supp0rt
    Participant

    Hello,

    I am trying to figure out a strange behaviour that happens on the shop age.

    I see the error below

    [PHP Warning]: Attempt to read property “query_vars” on null in wp-content/plugins/woocommerce/includes/class-wc-query.php on line 873
    Stack trace:
    #0 wp-content/plugins/woocommerce/includes/class-wc-query.php(873): cstm_error_handler()
    #1 wp-content/plugins/woocommerce/src/Internal/ProductAttributesLookup/Filterer.php(150): get_main_meta_query()
    #2 wp-content/themes/woodmart/inc/widgets/class-widget-layered-nav.php(459): get_filtered_term_product_counts()
    #3 wp-content/themes/woodmart/inc/widgets/class-widget-layered-nav.php(560): get_filtered_term_product_counts()
    #4 wp-content/themes/woodmart/inc/widgets/class-widget-layered-nav.php(244): layered_nav_list()
    #5 wp-includes/class-wp-widget.php(394): widget()
    #6 wp-includes/widgets.php(845): display_callback()
    #7 wp-content/themes/woodmart/sidebar.php(34): dynamic_sidebar()
    #8 wp-includes/template.php(810): require_once()
    #9 wp-includes/template.php(745): load_template()
    #10 wp-includes/general-template.php(136): locate_template()
    #11 wp-content/plugins/woocommerce/templates/global/sidebar.php(22): get_sidebar()
    #12 wp-content/plugins

    [PHP Warning]: Attempt to read property “post_count” on null in wp-content/plugins/woocommerce/includes/widgets/class-wc-widget-price-filter.php on line 80
    Stack trace:
    #0 wp-content/plugins/woocommerce/includes/widgets/class-wc-widget-price-filter.php(80): cstm_error_handler()
    #1 wp-includes/class-wp-widget.php(394): widget()
    #2 wp-includes/widgets.php(845): display_callback()
    #3 wp-content/themes/woodmart/sidebar.php(34): dynamic_sidebar()
    #4 wp-includes/template.php(810): require_once()
    #5 wp-includes/template.php(745): load_template()
    #6 wp-includes/general-template.php(136): locate_template()
    #7 wp-content/plugins/woocommerce/templates/global/sidebar.php(22): get_sidebar()
    #8 wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include()
    #9 wp-content/plugins/woocommerce/includes/wc-template-functions.php(1053): wc_get_template()
    #10 wp-includes/class-wp-hook.php(324): woocommerce_get_sidebar()
    #11 wp-includes/class-wp-hook.php(348): apply_filters()
    #12 wp-includes/plugin.php(517): do_action()
    #13 wp-content/themes/woodmart/woocommerce/archive-product.php(40): do_action()
    #14 wp-includes/template-loader.php(106): include()
    #15 wp-blog-header.php(19): require_once()
    #16 index.php(17): require()

    Because of this warning, the shop page appears empty every time the warnings above appear, and the price filter does not appear at all. But reappear after a while.

    I have also deactivated all the plugins and left only Woodmart and WooCommerce and the error still happens. I have also tried using WooCommerce and Storefront, and the error did not appear.

    Can you please assist me on this one?

    Best Regards

    #613092

    Artem Temos
    Keymaster

    Hello,

    Please disable any plugins not directly related to our theme and provide us with your admin access details. We will log in to your dashboard and investigate the issue. Please ensure that you only keep the following plugins that are necessary for our theme to work correctly:
    – WoodMart core
    – WooCommerce
    – Elementor/WPBakery Page Builder

    Thank you in advance.

    #613826

    supp0rt
    Participant

    Hello,

    I have provided a login using a token. The rest of the plugins are disabled.

    Let me know if you need anything else.

    Best Regards

    #613883

    Artem Temos
    Keymaster

    Could you please write step-by-step instructions on how to reproduce the issue on your website?

    #613951

    supp0rt
    Participant

    Unfortunatly no. I hope that you can help me on that one. I only have the debug logs and when the error appears every time I check the shop page there are no products on it and the filter by price does not appear at all. After that, I made the test site, disabled all plugins and left only Woodmart and woocommerce, and the error was still there. No cache was involved. After a while, the products and the price reappeared. So I do not know what is going on except for the warnings above.

    The settings that I have on the woocommerce might cause this problem. by enabling the lookup table? That might create conflicts with Woodmart?

    That’s all I know so far. except for the warnings with the stack trace that I pasted above.

    Let me know if there is something else I can help with.

    Best Regards

    • This reply was modified 9 months, 1 week ago by supp0rt. Reason: Added some extra information
    #614075

    Artem Temos
    Keymaster

    Hello,

    Unfortunately, we are unable to determine the exact steps to reproduce this issue based on the current details. Since the behavior you’re experiencing is inconsistent and not easily replicable, it’s challenging to pinpoint the root cause.

    Kind Regards

    #617351

    supp0rt
    Participant

    Would it be possible to add any checks so that if this happens, it should not make the whole shop appear with 0 products?

    I am not aware of the theme’s code in-depth and I can see that woocommerce also creates the error here, so I just suggest the above with good faith. if of course, this can work after the implementation.

    Best Regards

    #617460

    Artem Temos
    Keymaster

    Hello,

    According to the logs, errors appear in WooCommerce functions. We can’t add any checks there. The only way to fix this is to reproduce.

    Kind Regards

    #617514

    supp0rt
    Participant

    Ok. I understand that the situation. If I find what is causing this behaviour I will let you know, in case is something that can be added on your end.

    Thank you for your time and support.

    Best Regards

    #617522

    Artem Temos
    Keymaster

    Thank you for understanding. I will keep this topic open so you can write here anytime.

Viewing 10 posts - 1 through 10 (of 10 total)