Jump to content

Product in DB, not showing in CMS


mpatzekov

Recommended Posts

Did somebody experienced the problem I have now? I can see that 1 product is written in the database. Here is the output of :

 

mysql> select id_product,id_category_default, id_manufacturer, reference, date_add from ps_product;

 

What I get as output is:

 

+------------+---------------------+-----------------+-------------------+---------------------+
| id_product | id_category_default | id_manufacturer | reference         | date_add            |
+------------+---------------------+-----------------+-------------------+---------------------+
|       2773 |                   2 |               0 | BSN0003           | 2017-11-18 17:16:15 |
+------------+---------------------+-----------------+-------------------+---------------------+

 

So, I can see that this product is written in the DB, however it is not showing in Catalog --> Products. I have searched using Reference, ID (beause I see the ID),  name, but this product never shows up. On the other hand, I can see it in the frontend, but I need to delete/edit it.

Is this because the product is not associated with any manufacturer? Is this a bug? Am I doing something wrong? Somebody else with the same problem? What can I do in order to edit this product? My Prestashop is 1.6.1.4.



 

Edited by mpatzekov (see edit history)
Link to comment
Share on other sites

And what do you get when you type 

SELECT * FROM ps_category_product WHERE id_product=2773

To be correctly visible a product should be in all of the following tables: ps_product, ps_product_shop, ps_product_lang and ps_category_product. If any of them is missing you have a database inconsistency. 

Link to comment
Share on other sites

Good point. The out put of:

 

SELECT * FROM ps_category_product WHERE id_product=2773;

is:

+-------------+------------+----------+
| id_category | id_product | position |
+-------------+------------+----------+
|           2 |       2773 |      720 |
+-------------+------------+----------+
1 row in set (0.00 sec)

 

I am wondering can this problem be connected with the SQL QUERY in the cms? My current query (show sql query) is : 

SELECT a.`id_product`, b.`name` AS `name`, `reference`, manu.`name` AS `manufacturer`, a.`price` AS `price`, sa.`active` AS `active` , shop.`name` AS `shopname`, a.`id_shop_default`, image_shop.`id_image` AS `id_image`, cl.`name` AS `name_category`, sa.`price`, 0 AS `price_final`, a.`is_virtual`, pd.`nb_downloadable`, sav.`quantity` AS `sav_quantity`, sa.`active`, IF(sav.`quantity`<=0, 1, 0) AS `badge_danger` FROM `ps_product` a LEFT JOIN `ps_product_lang` b ON (b.`id_product` = a.`id_product` AND b.`id_lang` = 1 AND b.`id_shop` = 1) LEFT JOIN `ps_stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0 AND sav.id_shop = 1 AND sav.id_shop_group = 0 ) JOIN `ps_product_shop` sa ON (a.`id_product` = sa.`id_product` AND sa.id_shop = a.id_shop_default) LEFT JOIN `ps_category_lang` cl ON (sa.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = a.id_shop_default) LEFT JOIN `ps_shop` shop ON (shop.id_shop = a.id_shop_default) LEFT JOIN `ps_image_shop` image_shop ON (image_shop.`id_product` = a.`id_product` AND image_shop.`cover` = 1 AND image_shop.id_shop = a.id_shop_default) LEFT JOIN `ps_image` i ON (i.`id_image` = image_shop.`id_image`) LEFT JOIN `ps_product_download` pd ON (pd.`id_product` = a.`id_product`) INNER JOIN `ps_manufacturer` AS manu ON (manu.`id_manufacturer` = a.`id_manufacturer`) WHERE 1 ORDER BY a.`id_product` ASC LIMIT 0, 50

 

Edited by mpatzekov (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...