• Resolved madmax4ever

    (@madmax4ever)


    Hello,

    I finally found why the filter I’ve been using for different categories was not working properly on one of them.

    Context:
    On my biggest category, after upgrading to v2.0.4 (which, at this time, I did not realize: I only discovered this on v2.0.6!), selecting a filter value (checkbox) on an attribute (ajax along with autofilter) did not bring any product at all on the page!

    Analysis:
    I downgraded version on a staging site to check when it stopped working and discovered that if 2.0.3 was OK, all versions beyond were not. So I checked the cahcnges thanks to Winmerge and found that the query args were changed: 'post_status' => 'publish', was removed!
    But as it was still working with other categories (with fewer products), I did not get that immediately…

    Resolution:
    I modified /woo-product-filter/trunk/modules/woofilters/controller.php and reinserted 'post_status' => 'publish', before line 525.

    Finally:
    As your modification worked on other categories, there might be something to check about timeouts (as you’ve introduced some) or about the meta indexes… I let you check that.
    Otherwise, could you allow us to manage the post_status in query args?

    For the time being, I use my modified v2.0.6 version. Working well so far…

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter madmax4ever

    (@madmax4ever)

    Just to be clearer when I say

    did not bring any product at all on the page

    When I say so, I mean that the container were the products should appear is void. But I have the pages numbers below it…

    So here is the detailed behavior:

    1. I go to URL <site>/cat-1/ : I get products (no filter is applied yet) and a page index offering over 80 pages.
    2. I click on a checkbox with value ‘1’ to set a filter according to an attribute (let’s call it “myattrib”). Ajax call is done and URL becomes <site>/cat-1/?filter_myattrib=1 and I get no product BUT the pages index changed to only 30 pages.
    3. If 1) I refresh my page (so URL is still <site>/cat-1/?filter_myattrib=1) : I get the products… OR if 2) I click on page 2 on the index, I get the page 2 filtered products (URL becomes <site>/cat-1/page/2/?wpf_filtered=1&filter_myattrib=1), but if I clear the filter I get no products on page one (URL becomes <site>/cat-1/?wpf_filtered=1 — once again, refreshing this does load the products

    So there is definitely a problem, related to ajax queries at least.

    Plugin Author Nick McReynolds

    (@woobewoo)

    Hello @madmax4ever,

    Yes, we removed post_status, so that not only “publish” products, but also “private” products could be included in the selection.

    It’s not clear how lowering the restrictions could cause products to become unselectable.

    Please contact our support team, we need to analyze this situation in more detail – https://woobewoo.com/contact-us/

    Thread Starter madmax4ever

    (@madmax4ever)

    Hello @woobewoo,

    I get it, but what I am thinking now is that, by removing the query filtering arg publish -and not simply adding private to the post_status query arg to aim specifically those two statuses-, you normally also get all other remaining statuses as auto-draft, draft, future and trash.

    As we have many future products, maybe you get them, but they are “void” as they are not intended to be displayed to the customers yet… Giving this “blank page”?

    At least it seems to be the reason why to me. I’ve just tested in on a staging site (with just my theme, woocommerce and your plugin). So I modified your plugin on my prod site, inserting 'post_status' => array('publish', 'private'), rather than ‘post_status’ => ‘publish’, berfore line 525.

    If I have time for that, I’ll provide you access to my staging site for you to see.

    Thread Starter madmax4ever

    (@madmax4ever)

    Hello again,

    As a matter of fact, you can see it quite easily, even in back-office: when I am store manager (or admin), when I follow the steps I’ve given to reproduce the behavior, I get a page of 16 products: that seems OK but they all are planified products… That customer can’t see! So customer does get a blank page!
    If I put my correction after line 525, I get a good behavior, i.e. I see the same results customer gets!

    In fact, I understand I may have the same issue by adding private to post_status as customers may/do not have access to private products on the frontend. It could lead to the same glitch. I’ll stick to 'post_status' => 'publish', for now.

    So, I confirm: here is the problem!

    • This reply was modified 2 years, 10 months ago by madmax4ever.
    Thread Starter madmax4ever

    (@madmax4ever)

    Finally, this should help you reproduce this bug:

    1. Create a brand new staging site running WordPress 5.8.3
    2. Install WooCommerce 6.1.1 and Product Filter by WooBeWoo v2.0.6 plugins
    3. Create a product category
    4. Create a product attribute to filter on: say values are A and B for this attribute.
    5. Create and publish 20 products in this category, 14 having the A value for the attribute (just to be sure to be beyond the woocommerce default value of 12 products per page), others having B value
    6. Then, create and schedule 20 other products in this category, all having the A value for the attribute (makes things easier)
    7. Create and add a woofilter for this attribute on the category page, with Auto Filtering, Show Clear All Button and Reset All Filters On Page enabled
    8. Go to category page (as customer, so in frontend) and select A value as filter value… TADA

    If I forgot nothing, it does the trick.

    • This reply was modified 2 years, 10 months ago by madmax4ever.
    Plugin Author Nick McReynolds

    (@woobewoo)

    Hello @madmax4ever,

    Thanks for the detailed description.
    We are working on it.
    I will answer you later.

    Thread Starter madmax4ever

    (@madmax4ever)

    Thank you for managing now the private status as an option! (from v2.0.7)

    Plugin Author Nick McReynolds

    (@woobewoo)

    You`re welcome!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Query bug introduced in v2.0.4’ is closed to new replies.