FWW v2.40 DB Error: Too many tables; MySQL can only use 61 tables in a join

18 Comments

  1. harvey m.
    March 16, 2021 @ 2:55 am

    Additionally the filters do not display on the page (I am using the [fww_sidebar] shortcode, and it worked in the past) unless I go to the FWW settings page and click Save Settings, then it only works on the first page load. after that, the filters won’t load.
    Furthermore, when it actually does load, it loads ALL the filters, even the ones not related to that archive page. This never happened in the past.
    I did try clearing Redis and Nginx cache to no avail.

    Reply

  2. Dave H.
    March 18, 2021 @ 10:16 am

    Ok – for the filters you added, were a lot of them custom taxonomies? Are they hierarchical custom taxonomies?

    72 filters sounds like a LOT! With the way the underlying database is designed, to avoid the 61 table limit I will have to redesign the underlying table structures so that filters can be in a WHERE clause rather than a JOIN clause.

    re: the shortcode bug, thank you for letting me know. I’ve added an item to my bug list here:

    https://trello.com/c/8WXnL17h/132-fww-custom-taxonomy-filter

    Can you tell me what theme you are using too or which builder you are using? I’ll get that installed on my dev environment so I can replicate what you are seeing.

    Even more helpful would be if I could get SFTP and wp-admin access to that site if it’s a dev/test site?

    Reply

    • harvey m.
      March 18, 2021 @ 12:18 pm

      Thanks for your reply Dave!

      Out of all the filters, I have one “Show existing Filters”, one “Product Categories” (hierarchical) and around 70 “Attribute Filters”. I haven’t yet tried the new Custom Taxonomy filters. Also, the ~72 filters aren’t for all categories; Some categories have 10 filters, some 15, etc. but in all there are around 72.

      The site is using Oxygen Builder (which you should add support for, as it’s currently the fastest on the market). In case you didn’t know, Oxygen Builder disables any themes on the site as it is a site builder and not a page builder. (This could be why the styling of the filters is off, like I reported earlier here: https://www.wpintense.com/question/fww-css-issue/). Unfortunately I don’t have a dev server at the moment, but you can spin one up easily here: https://oxygenbuilder.com/try/

      Thanks again for all the work you are putting in!

      Reply

      • harvey m.
        March 18, 2021 @ 12:23 pm

        Also, as for the large amount of filters, maybe it would be more performant to be able to conditionally choose which Product Categories a filter should be visible, rather than switching to a WHERE clause. Would this be better?

        Reply

    • harvey
      May 11, 2021 @ 2:04 am

      Another thing to note, in general the FWW plugin slows down the entire website when enabled. When disabled, the website is fast and smooth again. I’m on a 4 core 8gb Nginx server with Redis Object and page cache. If I use Elasticsearch (without FWW) the website is also fast. It seems that there is something in FWW that is slowing down the whole site. FWW adds a few seconds to pages when activated.

      Reply

  3. Dave H.
    March 18, 2021 @ 12:45 pm

    I’ve added some fallback code to beta 2.45 so that it does INNER JOINs for the first 5 attributes that are selected but then reverts to the slower WHERE EXISTS for other attributes after that.

    This should still be very fast since the first 5 INNER JOIN attributes should reduce the result set size that the WHERE EXISTS has to filter across.

    Can you please try installing 2.45 and let me know if that fixes your error?

    Regarding Oxygen Builder – I’d like to add support for this – can you please send me a copy of the plugin and I’ll test it on my local dev? I’ll fix up the default CSS etc too since yes, you are correct, the filters ‘inherit’ whatever your theme has configured for WooCommerce filters, so if that CSS is removed by Oxygen I’ll have to implement some defaults.

    Reply

    • harvey m.
      March 18, 2021 @ 1:09 pm

      I only see the option to download up to beta v2.43

      Was the update pushed?

      Reply

      • Dave H.
        March 18, 2021 @ 1:41 pm

        Oops, sorry, check again now, 2.45 has been pushed.

        Reply

        • harvey m.
          March 19, 2021 @ 12:51 am

          I just tested v2.45 and the issue persists. I am still getting the same error: “Too many tables; MySQL can only use 61 tables in a join”

          Also, now the filters don’t render on the page at all. Only the clear filters button appears.

          Reply

  4. harvey m.
    May 2, 2021 @ 4:41 pm

    Hi Dave, I still have this issue in the latest beta, v2.53.

    I am currently using v2.27 as any newer version doesn’t work.

    Any update on if this is being worked on?

    Thank you!

    Reply

  5. harvey m.
    May 3, 2021 @ 3:19 am

    I tried again using only 3 filters (product cat and 2 attributes) ad I got the same error. Only very few products (1%) loaded on the page.

    SELECT t.term_id, t.name, t.slug, tm.meta_value+0 torder
    FROM wp_posts as p
    INNER JOIN wp_term_relationships tr
    ON tr.object_id = p.ID
    INNER JOIN wp_term_taxonomy tt on tr.term_taxonomy_id = tt.term_taxonomy_id and tt.taxonomy = ‘pa_manufacturer’
    INNER JOIN wp_terms t
    ON tt.term_id = t.term_id
    INNER JOIN wp_termmeta tm on t.term_id = tm.term_id and tm.meta_key = ‘order_pa_manufacturer’
    INNER JOIN wp_term_relationships ctr1 on ctr1 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt1 on ctr1 .term_taxonomy_id = ctt1.term_taxonomy_id and ctt1.term_id = 4473
    INNER JOIN wp_term_relationships ctr2 on ctr2 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt2 on ctr2 .term_taxonomy_id = ctt2.term_taxonomy_id and ctt2.term_id = 4473
    INNER JOIN wp_term_relationships ctr3 on ctr3 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt3 on ctr3 .term_taxonomy_id = ctt3.term_taxonomy_id and ctt3.term_id = 4473
    INNER JOIN wp_term_relationships ctr4 on ctr4 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt4 on ctr4 .term_taxonomy_id = ctt4.term_taxonomy_id and ctt4.term_id = 4473
    INNER JOIN wp_term_relationships ctr5 on ctr5 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt5 on ctr5 .term_taxonomy_id = ctt5.term_taxonomy_id and ctt5.term_id = 4473
    INNER JOIN wp_term_relationships ctr6 on ctr6 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt6 on ctr6 .term_taxonomy_id = ctt6.term_taxonomy_id and ctt6.term_id = 4473
    INNER JOIN wp_term_relationships ctr7 on ctr7 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt7 on ctr7 .term_taxonomy_id = ctt7.term_taxonomy_id and ctt7.term_id = 4473
    INNER JOIN wp_term_relationships ctr8 on ctr8 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt8 on ctr8 .term_taxonomy_id = ctt8.term_taxonomy_id and ctt8.term_id = 4473
    INNER JOIN wp_term_relationships ctr9 on ctr9 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt9 on ctr9 .term_taxonomy_id = ctt9.term_taxonomy_id and ctt9.term_id = 4473
    INNER JOIN wp_term_relationships ctr10 on ctr10 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt10 on ctr10 .term_taxonomy_id = ctt10.term_taxonomy_id and ctt10.term_id = 4473
    INNER JOIN wp_term_relationships ctr11 on ctr11 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt11 on ctr11 .term_taxonomy_id = ctt11.term_taxonomy_id and ctt11.term_id = 4473
    INNER JOIN wp_term_relationships ctr12 on ctr12 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt12 on ctr12 .term_taxonomy_id = ctt12.term_taxonomy_id and ctt12.term_id = 4473
    INNER JOIN wp_term_relationships ctr13 on ctr13 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt13 on ctr13 .term_taxonomy_id = ctt13.term_taxonomy_id and ctt13.term_id = 4473
    INNER JOIN wp_term_relationships ctr14 on ctr14 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt14 on ctr14 .term_taxonomy_id = ctt14.term_taxonomy_id and ctt14.term_id = 4473
    INNER JOIN wp_term_relationships ctr15 on ctr15 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt15 on ctr15 .term_taxonomy_id = ctt15.term_taxonomy_id and ctt15.term_id = 4473
    INNER JOIN wp_term_relationships ctr16 on ctr16 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt16 on ctr16 .term_taxonomy_id = ctt16.term_taxonomy_id and ctt16.term_id = 4473
    INNER JOIN wp_term_relationships ctr17 on ctr17 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt17 on ctr17 .term_taxonomy_id = ctt17.term_taxonomy_id and ctt17.term_id = 4473
    INNER JOIN wp_term_relationships ctr18 on ctr18 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt18 on ctr18 .term_taxonomy_id = ctt18.term_taxonomy_id and ctt18.term_id = 4473
    INNER JOIN wp_term_relationships ctr19 on ctr19 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt19 on ctr19 .term_taxonomy_id = ctt19.term_taxonomy_id and ctt19.term_id = 4473
    INNER JOIN wp_term_relationships ctr20 on ctr20 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt20 on ctr20 .term_taxonomy_id = ctt20.term_taxonomy_id and ctt20.term_id = 4473
    INNER JOIN wp_term_relationships ctr21 on ctr21 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt21 on ctr21 .term_taxonomy_id = ctt21.term_taxonomy_id and ctt21.term_id = 4473

    Reply

  6. harvey m.
    May 3, 2021 @ 3:19 am


    INNER JOIN wp_term_relationships ctr22 on ctr22 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt22 on ctr22 .term_taxonomy_id = ctt22.term_taxonomy_id and ctt22.term_id = 4473
    INNER JOIN wp_term_relationships ctr23 on ctr23 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt23 on ctr23 .term_taxonomy_id = ctt23.term_taxonomy_id and ctt23.term_id = 4473
    INNER JOIN wp_term_relationships ctr24 on ctr24 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt24 on ctr24 .term_taxonomy_id = ctt24.term_taxonomy_id and ctt24.term_id = 4473
    INNER JOIN wp_term_relationships ctr25 on ctr25 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt25 on ctr25 .term_taxonomy_id = ctt25.term_taxonomy_id and ctt25.term_id = 4473
    INNER JOIN wp_term_relationships ctr26 on ctr26 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt26 on ctr26 .term_taxonomy_id = ctt26.term_taxonomy_id and ctt26.term_id = 4473
    INNER JOIN wp_term_relationships ctr27 on ctr27 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt27 on ctr27 .term_taxonomy_id = ctt27.term_taxonomy_id and ctt27.term_id = 4473
    INNER JOIN wp_term_relationships ctr28 on ctr28 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt28 on ctr28 .term_taxonomy_id = ctt28.term_taxonomy_id and ctt28.term_id = 4473
    INNER JOIN wp_term_relationships ctr29 on ctr29 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt29 on ctr29 .term_taxonomy_id = ctt29.term_taxonomy_id and ctt29.term_id = 4473
    INNER JOIN wp_term_relationships ctr30 on ctr30 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt30 on ctr30 .term_taxonomy_id = ctt30.term_taxonomy_id and ctt30.term_id = 4473
    INNER JOIN wp_term_relationships ctr31 on ctr31 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt31 on ctr31 .term_taxonomy_id = ctt31.term_taxonomy_id and ctt31.term_id = 4473
    INNER JOIN wp_term_relationships ctr32 on ctr32 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt32 on ctr32 .term_taxonomy_id = ctt32.term_taxonomy_id and ctt32.term_id = 4473
    INNER JOIN wp_term_relationships ctr33 on ctr33 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt33 on ctr33 .term_taxonomy_id = ctt33.term_taxonomy_id and ctt33.term_id = 4473
    INNER JOIN wp_term_relationships ctr34 on ctr34 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt34 on ctr34 .term_taxonomy_id = ctt34.term_taxonomy_id and ctt34.term_id = 4473
    INNER JOIN wp_term_relationships ctr35 on ctr35 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt35 on ctr35 .term_taxonomy_id = ctt35.term_taxonomy_id and ctt35.term_id = 4473
    INNER JOIN wp_term_relationships ctr36 on ctr36 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt36 on ctr36 .term_taxonomy_id = ctt36.term_taxonomy_id and ctt36.term_id = 4473
    INNER JOIN wp_term_relationships ctr37 on ctr37 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt37 on ctr37 .term_taxonomy_id = ctt37.term_taxonomy_id and ctt37.term_id = 4473
    INNER JOIN wp_term_relationships ctr38 on ctr38 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt38 on ctr38 .term_taxonomy_id = ctt38.term_taxonomy_id and ctt38.term_id = 4473
    INNER JOIN wp_term_relationships ctr39 on ctr39 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt39 on ctr39 .term_taxonomy_id = ctt39.term_taxonomy_id and ctt39.term_id = 4473
    INNER JOIN wp_term_relationships ctr40 on ctr40 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt40 on ctr40 .term_taxonomy_id = ctt40.term_taxonomy_id and ctt40.term_id = 4473
    INNER JOIN wp_term_relationships ctr41 on ctr41 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt41 on ctr41 .term_taxonomy_id = ctt41.term_taxonomy_id and ctt41.term_id = 4473
    INNER JOIN wp_term_relationships ctr42 on ctr42 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt42 on ctr42 .term_taxonomy_id = ctt42.term_taxonomy_id and ctt42.term_id = 4473
    INNER JOIN wp_term_relationships ctr43 on ctr43 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt43 on ctr43 .term_taxonomy_id = ctt43.term_taxonomy_id and ctt43.term_id = 4473
    INNER JOIN wp_term_relationships ctr44 on ctr44 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt44 on ctr44 .term_taxonomy_id = ctt44.term_taxonomy_id and ctt44.term_id = 4473
    INNER JOIN wp_term_relationships ctr45 on ctr45 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt45 on ctr45 .term_taxonomy_id = ctt45.term_taxonomy_id and ctt45.term_id = 4473
    INNER JOIN wp_term_relationships ctr46 on ctr46 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt46 on ctr46 .term_taxonomy_id = ctt46.term_taxonomy_id and ctt46.term_id = 4473
    INNER JOIN wp_term_relationships ctr47 on ctr47 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt47 on ctr47 .term_taxonomy_id = ctt47.term_taxonomy_id and ctt47.term_id = 4473
    INNER JOIN wp_term_relationships ctr48 on ctr48 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt48 on ctr48 .term_taxonomy_id = ctt48.term_taxonomy_id and ctt48.term_id = 4473
    INNER JOIN wp_term_relationships ctr49 on ctr49 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt49 on ctr49 .term_taxonomy_id = ctt49.term_taxonomy_id and ctt49.term_id = 4473
    INNER JOIN wp_term_relationships ctr50 on ctr50 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt50 on ctr50 .term_taxonomy_id = ctt50.term_taxonomy_id and ctt50.term_id = 4473
    INNER JOIN wp_term_relationships ctr51 on ctr51 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt51 on ctr51 .term_taxonomy_id = ctt51.term_taxonomy_id and ctt51.term_id = 4473
    INNER JOIN wp_term_relationships ctr52 on ctr52 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt52 on ctr52 .term_taxonomy_id = ctt52.term_taxonomy_id and ctt52.term_id = 4473
    INNER JOIN wp_term_relationships ctr53 on ctr53 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt53 on ctr53 .term_taxonomy_id = ctt53.term_taxonomy_id and ctt53.term_id = 4473
    INNER JOIN wp_term_relationships ctr54 on ctr54 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id inner join wp_term_taxonomy ggp on gp.parent = ggp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ and ggp.taxonomy = ‘product_cat’ ) ctt54 on ctr54 .term_taxonomy_id = ctt54.term_taxonomy_id and ctt54.term_id = 4473
    INNER JOIN wp_term_relationships ctr55 on ctr55 .object_id = p.ID
    INNER JOIN ( select term_id, parent as ancestor_id, term_taxonomy_id from wp_term_taxonomy where taxonomy = ‘product_cat’ union all select p.term_id, p.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ union all select gp.term_id, gp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.parent = p.term_id inner join wp_term_taxonomy gp on p.parent = gp.term_id where c.taxonomy = ‘product_cat’ and p.taxonomy = ‘product_cat’ and gp.taxonomy = ‘product_cat’ union all select ggp.term_id, ggp.parent as ancestor_id, c.term_taxonomy_id from wp_term_taxonomy c inner join wp_term_taxonomy p on c.par

    Reply

  7. harvey m.
    May 6, 2021 @ 5:25 am

    Just an update,

    As I was on v2.26 and newer versions didn’t work, I decided to update incrementally. I installed v2.27, 28 29 30 31 etc. all the way the the latest beta, while clearing cache and saving settings and permalinks, and now it seems to work! Perhaps you made some backwards incompatible changes.

    The only issue I found so far is if I’m on a product category page, and then select an attribute filter, the page displays the “Shop” template, and not the product category archive template. Because of this, the page title says “Shop” instead of the product category name.

    I will keep an eye out for more bugs.

    Thanks a lot for the updates, and congrats on the new team!

    Reply

  8. harvey m.
    May 6, 2021 @ 6:06 am

    Another update:

    Currently all my attributes are set to “Slug” in “Attribute URL Config”. However, if I change some to “URL Param”, and then I go to a product category page and filter by one of those attributes, it doesn’t load ANY products. I tried saving permalinks.

    Additionally, all my product attribute archive pages meta titles are overwritten by your plugin, even though I didn’t touch those settings. I use Rankmath for SEO, and have all my titles in there. Is there a way to disable this feature in FWW, because with FWW enabled all my meta titles are blank!

    Thank you!

    Reply

    • Dave H.
      May 7, 2021 @ 12:55 am

      Can you please provide a link to the Rankmath zip file you use so I can download it to my dev environment and test it. Have you tried unticking the box to overrule yoast? i think it would be the same function.

      Reply

  9. harvey m.
    May 7, 2021 @ 2:45 am

    Here it is: https://wordpress.org/plugins/seo-by-rank-math/

    I haven’t touched that setting. It is disabled.

    Also, query monitor is saying that the plugin is causing slow queries.

    Load times are pretty slow.

    Reply

  10. Dave H.
    May 20, 2021 @ 3:04 pm

    These are all fixed in beta 2.66 – the ‘override yoast’ option is renamed to ‘override meta titles and meta descriptions’ – if you don’t enable that, it won’t override your rank math seo stuff.

    Reply

  11. Dave H.
    September 17, 2021 @ 2:46 pm

    This was fixed again (failed first attempt) back when I added the wp_fww_ancestors table. This single table is prepopulated in the background and eliminates the need to join to so many tables.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

We use cookies

We use cookies for various things on our site, including our on-site chat bubble (if you use it), our comment forms (if you use them) and for session handling (if you log in).

Other than that, we use cookies to identify where traffic came from to help us understand which traffic turns into sales, we use a cookie for Google Analytics traffic analysis and we use a cookie to customise adverts for our own products we think you'll be interested in.

You can read more detail in our privacy policy page. Please click 'Accept' or 'Decline' to continue.