categories - Product Category page showing all products

admin2025-01-08  3

Our WP system uses the following plugins:

  • WooCommerce v3.4.4
  • WooCommerce Stock Manager v1.2.6
  • Display Productfor WooCommerce v2.0.19
  • Sorting WooCommerce Pro v4.0
  • Salient Theme v7.0.8
  • Salient Visual Composer v4.11.2

Following a migration, the product category web pages no longer work correctly. They show all products instead of those from the selected category. Also, the filter/sorter has appeared below the header. However, the products show the correct categories in admin.

How would I best debug this issue?

I can output the SQL that selects the category name using print $wp_query->request; in the page.php template, but how can I debug the product selection that references the category, please?

Our WP system uses the following plugins:

  • WooCommerce v3.4.4
  • WooCommerce Stock Manager v1.2.6
  • Display Productfor WooCommerce v2.0.19
  • Sorting WooCommerce Pro v4.0
  • Salient Theme v7.0.8
  • Salient Visual Composer v4.11.2

Following a migration, the product category web pages no longer work correctly. They show all products instead of those from the selected category. Also, the filter/sorter has appeared below the header. However, the products show the correct categories in admin.

How would I best debug this issue?

I can output the SQL that selects the category name using print $wp_query->request; in the page.php template, but how can I debug the product selection that references the category, please?

Share Improve this question edited Aug 17, 2018 at 12:31 Ben Löffel 1347 bronze badges asked Aug 17, 2018 at 11:19 Nick WNick W 1231 silver badge6 bronze badges 2
  • I think the product data looks ok, I've checked it with the following Sql: SELECT p.ID as product_id, p.post_title as product_name, p.post_status, t.term_id as cat_id, t.name as category_name FROM wp_posts as p LEFT JOIN wp_term_relationships rs ON (rs.object_id = p.ID) LEFT JOIN wp_term_taxonomy tt ON (rs.term_taxonomy_id = tt.term_taxonomy_id) LEFT JOIN wp_terms t ON (tt.term_id = t.term_id) WHERE (p.post_type = "product" or p.post_type = "product_variation") AND tt.taxonomy = "product_cat" AND p.post_status <> "closed" – Nick W Commented Aug 17, 2018 at 16:07
  • I've compared the difference between the options table for the site that works and the one that doesn't. I notice some differences for the option values for option_name 'salient_redux', but they only look like difference in id values eg s:86: compared to s:87: for image urls in the uploads directory. – Nick W Commented Aug 17, 2018 at 17:29
Add a comment  | 

1 Answer 1

Reset to default 0

I found there were 195 dp_* settings missing the correct settings in the ‘wp_postmeta’ table, once they were replaced it worked. I assume they were lost during the migration.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736270407a1426.html

最新回复(0)