Support » Plugin: Nested Pages » Version 1.6.3 breaks woocommerce in child page

  • fiskhandlarn

    (@fiskhandlarn)


    When the woocommerce shop page is set to a page that is a child page, this plugin interferes with the product query, resulting in no products being found.

    In wp-nested-pages 1.6.3 $wp_query->request is set to:

    SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1  AND 
    wp_posts.ID = 1608 AND 
    ( 
      ( wp_postmeta.meta_key = '_visibility' AND wp_postmeta.meta_value IN ('visible','catalog') )
    ) AND wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'closed' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.post_status = 'private' OR wp_posts.post_status = 'hidden') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC, wp_posts.ID DESC LIMIT 0, 10

    (where 1608 is the page id I’ve set the shop page to)
    This generates an empty sql result.

    In wp-nested-pages 1.5.4 $wp_query->request is set to:

    SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1  AND 
    ( 
      ( wp_postmeta.meta_key = '_visibility' AND wp_postmeta.meta_value IN ('visible','catalog') )
    ) AND wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'closed' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.post_status = 'private' OR wp_posts.post_status = 'hidden') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC, wp_posts.ID DESC LIMIT 0, 10

    This generates the wanted sql results.

    This does not happen if I set the woocommerce shop page to a top level page (i.e. AND wp_posts.ID = x is not injected)

    • This topic was modified 5 years ago by fiskhandlarn. Reason: added linebreaks in sql statements to clarify the difference
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter fiskhandlarn

    (@fiskhandlarn)

    The problem seems to lie in RedirectsFrontEnd::parseRequest() always setting page_id:
    $wp->query_vars['page_id'] = $page[0]->ID;

    Thread Starter fiskhandlarn

    (@fiskhandlarn)

    Sorry, this problem is in version 1.6.5.1, not 1.6.3 (which I read in readme.txt).

    Thread Starter fiskhandlarn

    (@fiskhandlarn)

    This seems to resolved as of 1.6.5.2. Or maybe it was an issue introduced by WooCommerce which has now also been updated. Anyhow, this issue can now be marked as solved. 🙂

    • This reply was modified 4 years, 11 months ago by fiskhandlarn.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Version 1.6.3 breaks woocommerce in child page’ is closed to new replies.