Home Forums WoodMart support forum Warning on php does not load the products in shop page

Warning on php does not load the products in shop page

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

    supp0rt
    Participant

    Hello,

    I am using Woodmart and for some reason, I see a warning on the server logs that does not let the products load on the shop page. Can you please assist me with that, as I can not find the source of the problem? I have pasted below the message.

    Best Regards

    #542708

    Artem Temos
    Keymaster

    Hello,

    Please, disable all plugins that are not related to our theme and provide us with your admin access. We will log in and check what is wrong there. You can leave only the following plugins that are required for our theme:
    WoodMart core
    WooCommerce
    Elementor/WPBakery page builder

    Thank you in advance

    #542796

    supp0rt
    Participant

    I have created a staging site, provided temporary access and disabled all the plugins.

    In case the problem does not show up, please check the live site URL I provided.

    Let me know if there is anything else you need to know.

    Best Regards

    #542844

    Artem Temos
    Keymaster

    We just opened the shop page but don’t see any errors. Could you please clarify how to reproduce the problem?

    #542882

    supp0rt
    Participant

    I can see what you are saying. The problem can be seen on the live site on mobile devices.

    So I will try to find how this is reproduced:

    Here are some thoughts and let me know if you can assist:

    AH01071: Got error 'PHP message: 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
    
    PHP message: PHP Warning: Attempt to read property "query_vars" on null in .../wp-content/plugins/woocommerce/includes/class-wc-query.php on line 873 

    These are the errors included on the server logs. The list goes on for about 10 to 12 lines on /class-wc-query.php

    I use WP-rocket to page cache the content. Exclusions have been added to the exclusion list but this error pops up after some time. I also use AJAX on the shop pages.

    Is there any query or is there any other file/option or something, that must be excluded, so that the post_count to finish the process of WC()->query->get_main_query() or be to be initialized properly?

    This is like going in blind, as I do not have some standard info on how to reproduce it.

    Any help would be appreciated. I have also posted the link below from the live site, where I can see the shop page empty of products, but on mobiles. This might happen as I use a separate cache for mobile devices, and it might not be flashed yet.

    Any help or guidelines would be appreciated as most of the above might be some wrong guesses.

    Best Regards

    #542942

    Artem Temos
    Keymaster

    As far as we can see, this error is not related to our theme at all. That is why we need to be able to reproduce it and then check why it appears and if it is caused by WoodMart or not.

    Kind Regards

    #543127

    supp0rt
    Participant

    I understand what you say. Can you please provide me with information regarding the AJAX call for the products on the shop pages so I can try to exclude it from the delay or defer the js list on wp-rocket?

    As I can not give you proper feedback on how you can reproduce it let me know about the information that you can provide, because If I can not find what is causing the problem, every support will claim that is not the plugin that fails on something.

    Let me know your thoughts.

    Best Regards

    #543194

    Artem Temos
    Keymaster

    Here is a file responsible for the AJAX shop page functionality /js/scripts/wc/ajaxFilters.min.js

    Kind Regards

    #548110

    supp0rt
    Participant

    Excuse my late response, but I was monitoring the site’s behaviour.


    @admin
    . Thank you for your response. It helped me to narrow down the problem.

    It seems that the culprit was an option inside the Plesk panel and under the security tab.
    “Disable PHP execution in cache directories.” This was preventing the cached scripts from running properly, including woocommerce init. So if a widget was asking for a price tag in all products, the query was returning null.

    It might be something else in another case, but for this one, when I disabled this, the error disappeared on the same setup, with no updates occurring on the plugin.

    Appreciate the help that you provided on the matter. You may close the ticket.

    Best Regards

    • This reply was modified 1 year, 2 months ago by supp0rt.
    #548152

    Artem Temos
    Keymaster

    We are glad that you sorted it out! Feel free to contact us if you have any further questions.

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

The topic ‘Warning on php does not load the products in shop page’ is closed to new replies.