Anton_L Posted February 7 Share Posted February 7 Hello, A couple of days ago, I encountered an issue - products stopped displaying in the "products" section of the backend. I'm not entirely sure of the cause as there have been no changes to the project in the last month. Before noticing the problem, I installed this module: [link to the module]. I didn't notice if the error occurred before or after the installation. Later, I removed it and noticed this problem. The products are not displaying only in this section. They are present on the frontend, in the search in the admin panel, etc. I've spent several days trying to solve this problem, but so far, nothing has worked. The only thing I noticed is that there might be an incorrect SQL query for displaying products. I copied it from the products section and pasted it into the SQL manager. It returns an empty result. Then, I took an SQL query from the default PRESTASHOP theme and also pasted it into the SQL manager - it worked and displayed the necessary products. Here's the SQL code from my back office: SELECT pc.`position`, pc.`id_category`, p.`id_product`, p.`reference`, p.`id_shop_default`, ps.`price` AS `price_tax_excluded`, ps.`ecotax` AS `ecotax_tax_excluded`, ps.`id_tax_rules_group`, ps.`active`, pl.`name`, pl.`link_rewrite`, cl.`name` AS `category`, img_shop.`id_image`, img_lang.legend, p.`id_tax_rules_group`, (ps.`price` + ps.`ecotax`) AS `final_price_tax_excluded`, IF(sa.`quantity` IS NULL OR sa.`quantity` = '', 0, sa.`quantity`) AS quantity FROM psv5_product p INNER JOIN psv5_product_shop ps ON ps.`id_product` = p.`id_product` AND ps.`id_shop` = 1 LEFT JOIN psv5_shop s ON s.`id_shop` = ps.`id_shop` LEFT JOIN psv5_product_lang pl ON pl.`id_product` = p.`id_product` AND pl.`id_lang` = 2 AND pl.`id_shop` = 1 RIGHT JOIN psv5_category_product pc ON p.`id_product` = pc.`id_product` AND pc.id_category = 118 LEFT JOIN psv5_stock_available sa ON sa.`id_product` = p.`id_product` AND sa.`id_product_attribute` = 0 AND sa.`id_shop` = 1 LEFT JOIN psv5_category_lang cl ON cl.`id_category` = ps.`id_category_default` AND cl.`id_lang` = 2 AND cl.`id_shop` = 1 LEFT JOIN psv5_image_shop img_shop ON img_shop.`id_product` = ps.`id_product` AND img_shop.`cover` = 1 AND img_shop.`id_shop` = 1 LEFT JOIN psv5_image_lang img_lang ON img_shop.`id_image` = img_lang.`id_image` AND img_lang.`id_lang` = 2 WHERE p.`state` = 1 ORDER BY name desc LIMIT 100 Here's the SQL code from default Prestashop back office: SELECT p.`id_product`, p.`reference`, p.`id_shop_default`, ps.`price` AS `price_tax_excluded`, ps.`ecotax` AS `ecotax_tax_excluded`, ps.`id_tax_rules_group`, ps.`active`, pl.`name`, pl.`link_rewrite`, cl.`name` AS `category`, img_shop.`id_image`, img_lang.legend, p.`id_tax_rules_group`, (ps.`price` + ps.`ecotax`) AS `final_price_tax_excluded`, IF(sa.`quantity` IS NULL OR sa.`quantity` = '', 0, sa.`quantity`) AS quantity FROM psv5_product p INNER JOIN psv5_product_shop ps ON ps.`id_product` = p.`id_product` AND ps.`id_shop` = 1 LEFT JOIN psv5_shop s ON s.`id_shop` = ps.`id_shop` LEFT JOIN psv5_product_lang pl ON pl.`id_product` = p.`id_product` AND pl.`id_lang` = 6 AND pl.`id_shop` = 1 LEFT JOIN psv5_stock_available sa ON sa.`id_product` = p.`id_product` AND sa.`id_product_attribute` = 0 AND sa.`id_shop` = 1 LEFT JOIN psv5_category_lang cl ON cl.`id_category` = ps.`id_category_default` AND cl.`id_lang` = 6 AND cl.`id_shop` = 1 LEFT JOIN psv5_image_shop img_shop ON img_shop.`id_product` = ps.`id_product` AND img_shop.`cover` = 1 AND img_shop.`id_shop` = 1 LEFT JOIN psv5_image_lang img_lang ON img_shop.`id_image` = img_lang.`id_image` AND img_lang.`id_lang` = 6 WHERE p.`state` = 1 ORDER BY id_product desc LIMIT 20 Perhaps the problem is in this request, but I can’t figure out where and what I need to change for it to work correctly. On this project, I only work on the frontend part and have limited understanding of the backend. Please help me figure out the problem. If there's any missing information here, let me know, and I'll provide it. Thank you! Prestashop version: 8.1.0 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now