Jump to content

SOLVED - All products vanished - Prestashop 1.6.13


Colin Earle

Recommended Posts

I've had my shop up and running successfully for a few months now without any problems, till now.

Something happened, not sure what, perhaps I clicked on something, anyway I've spend a few weeks trying to resolve this problem but got nowhere.

 

On the Catalogue ->Products screen, all my products vanished while I was entering a few new products. I can't find any filter that I may have accidentally clicked.

 

What I have found is:

Viewing the SQL via ">_" button, I see in the WHERE clause WHERE 1 AND sa.`active` = 0    

So I can only see inactive products. I've changed some products to inactive, and then they appear.

 

I am not using Multi Store mode (some discussions have indicated this may be the cause).

I've looked through the code and can't find where this filter is set.

 

How do I clear this filter?

 

 

Thanks,

Colin.

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

You should post the FULL sql not only a little part. The alias "sa" in the sa.active might not be related to products but some other table.

Or simply run these two SQL and post the results here:
 

select count(id_product) from ps_product;

select count(id_product) from ps_product_shop;

 

This will give us the number of rows in the two most imortant tables.

Link to comment
Share on other sites

My bad, I meant to paste this at the end.

 

SELECT a.`id_product`, b.`name` AS `name`, `reference`, 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_group = 1 AND sav.id_shop = 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` AND pd.`active` = 1) WHERE 1 AND sa.`active` = 0 ORDER BY a.`id_product` asc LIMIT 0, 50

 

Quote

select count(id_product) from ps_product;

124

select count(id_product) from ps_product_shop;

124
124
Link to comment
Share on other sites

As no products are listed, I have to update the status directly in the database. Once inactive, the products appear as inactive. This does not change the products count.

Changing them back to active via clicking on the status makes them disappear again, this does not change the products count.

Link to comment
Share on other sites

I spoke from the backoffice product list filter, not from database. If you current setup only shows active = 0 and you switch the filters to active, it show a other SQL statement. In other words: does toggle the list active yes / no filter change the corresponding SQL?

 

At this moment I am only refering to the SQL generated - not to the result it brings back.

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

Solved. 

I created a new admin super user and logged in, the filter appeared.

Logged out, logged in as the original user, and the filter is back.

 

I'm still not sure what caused it, but it's possible that logging out and logging back in might have fixed it, or it could be cache or a cookie.

 

Thanks so much for your help Scully

Link to comment
Share on other sites

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...