Home › Forums › WoodMart support forum › PHP Warning that is null creates an empty shop
PHP Warning that is null creates an empty shop
- This topic has 9 replies, 2 voices, and was last updated 9 months ago by
Artem Temos.
-
AuthorPosts
-
November 18, 2024 at 12:25 pm #612912
supp0rtParticipantHello,
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
November 18, 2024 at 7:08 pm #613092
Artem TemosKeymasterHello,
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 BuilderThank you in advance.
November 20, 2024 at 3:42 pm #613826
supp0rtParticipantHello,
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
November 20, 2024 at 4:36 pm #613883
Artem TemosKeymasterCould you please write step-by-step instructions on how to reproduce the issue on your website?
November 20, 2024 at 6:51 pm #613951
supp0rtParticipantUnfortunatly 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
November 21, 2024 at 10:00 am #614075
Artem TemosKeymasterHello,
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
November 28, 2024 at 10:49 pm #617351
supp0rtParticipantWould 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
November 29, 2024 at 10:14 am #617460
Artem TemosKeymasterHello,
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
November 29, 2024 at 11:22 am #617514
supp0rtParticipantOk. 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
November 29, 2024 at 11:28 am #617522
Artem TemosKeymasterThank you for understanding. I will keep this topic open so you can write here anytime.
-
This reply was modified 9 months, 1 week ago by
-
AuthorPosts
- You must be logged in to create new topics. Login / Register