• Resolved devscharmach

    (@devscharmach)


    Hi!
    Great module, but I have problem with some filters. I have filter for example “shape”. When i select options “rectangular” and “round” there ale only visible products from first attribute. Logic of all filters is set to “OR”. I check all queries with Query Monitor plugin and I foud that modyfication in main query is good, but there is another query form Elementor Pro, where is duplicated taxonomy filter with mistake.

    Main query:

    SELECT SQL_CALC_FOUND_ROWS ses_posts.ID
    FROM ses_posts
    LEFT JOIN ses_term_relationships
    ON (ses_posts.ID = ses_term_relationships.object_id)
    LEFT JOIN ses_term_relationships AS tt1
    ON (ses_posts.ID = tt1.object_id)
    LEFT JOIN ses_term_relationships AS tt2
    ON (ses_posts.ID = tt2.object_id)
    WHERE 1=1
    AND ( ses_term_relationships.term_taxonomy_id IN (90)
    AND tt1.term_taxonomy_id IN (369,371)
    AND tt2.term_taxonomy_id IN (90) )
    AND ((ses_posts.post_type = 'product'
    AND (ses_posts.post_status = 'publish'
    OR ses_posts.post_status = 'acf-disabled'
    OR ses_posts.post_status = 'private')))
    GROUP BY ses_posts.ID
    ORDER BY ses_posts.menu_order ASC, ses_posts.post_title ASC
    LIMIT 0, 20 /* Current SQL Query is filtered by Filter Everything plugin */

    And Elementor Pro query:

    	SELECT SQL_CALC_FOUND_ROWS ses_posts.ID
    FROM ses_posts
    LEFT JOIN ses_term_relationships
    ON (ses_posts.ID = ses_term_relationships.object_id)
    LEFT JOIN ses_term_relationships AS tt1
    ON (ses_posts.ID = tt1.object_id)
    LEFT JOIN ses_term_relationships AS tt2
    ON (ses_posts.ID = tt2.object_id)
    LEFT JOIN ses_term_relationships AS tt3
    ON (ses_posts.ID = tt3.object_id)
    WHERE 1=1
    AND ( ses_term_relationships.term_taxonomy_id IN (90)
    AND tt1.term_taxonomy_id IN (369,371)
    AND tt2.term_taxonomy_id IN (369)
    AND tt3.term_taxonomy_id IN (90) )
    AND ((ses_posts.post_type = 'product'
    AND (ses_posts.post_status = 'publish'
    OR ses_posts.post_status = 'acf-disabled'
    OR ses_posts.post_status = 'private')))
    GROUP BY ses_posts.ID
    ORDER BY ses_posts.menu_order ASC, ses_posts.post_title ASC
    LIMIT 0, 20 /* Current SQL Query is filtered by Filter Everything plugin */

    Line AND tt2.term_taxonomy_id IN (369) causes problems.

    Can You tell me how to fix this problem?

    • This topic was modified 2 years, 9 months ago by devscharmach.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter devscharmach

    (@devscharmach)

    Additional info: if i set additional attribute, for example Colour: black, problem diappears…

    Plugin Author stepasyuk

    (@stepasyuk)

    Hi @devscharmach

    Thank you for using Filter Everything and for your warm words about the plugin.

    In general filtering should not affect on two WP_Queries on the page, but only on the Main Query (for the Free version of the plugin). But your case is interesting for me, maybe there is a bug in my plugin or maybe you have additional hooks that modifies your WP_Query.

    Do you use the latest version of the plugin?

    Thread Starter devscharmach

    (@devscharmach)

    Yes, it’s 1.6.5 version. WordPress: 6.0 (on 5.9 there is the same problem).

    I think I have the same problem, but with WooCommerce.
    there seem to be an issue about the timing at which addFilterQueryToWpQuery is called. The $wp_query seem to be empty at the time. Probably a bad hook?
    I’ve PMed you directly @stepasyuk with more information about it.

    Thread Starter devscharmach

    (@devscharmach)

    Any news about this problem?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Problem with two selected values from one filter’ is closed to new replies.