vietnam Posted September 11, 2012 Share Posted September 11, 2012 I want to modify admintracking.php in a way that shows me the products that don`t have a image yet. I know how can i see all the products that have images, using this SQL statement : Quote SELECT * FROM `ps_image` WHERE `cover` =1 But the reverse is not possible I was thinking of something like "select products that are only in ps_product, and are not in ps_image" But i don`t know how can i do something like this. If you have a idea, please help me Link to comment Share on other sites More sharing options...
vietnam Posted September 11, 2012 Author Share Posted September 11, 2012 I solved it. With a bit of reading from here http://dev.mysql.com/doc/refman/5.1/en/select.html i figure it out how to compare the 2 products. Now i will have to figure it how to exclude the disabled products (Solved) This is directly for ps_ If you have another database, you have to change ps_ with your database. (Solved that too ) Quote SELECT * FROM `ps_product` LEFT JOIN `ps_image` ON `ps_product`.`id_product`=`ps_image`.`id_product` WHERE `ps_image`.`id_product` IS NULL AND `ps_product`.`active` = 1 So the code is like this Quote SELECT `'._DB_PREFIX_.'product`.`id_product` FROM `'._DB_PREFIX_.'product` LEFT JOIN `'._DB_PREFIX_.'image` ON `'._DB_PREFIX_.'product`.`id_product`=`'._DB_PREFIX_.'image`.`id_product` WHERE `'._DB_PREFIX_.'image`.`id_product` IS NULL AND `'._DB_PREFIX_.'product`.`active` = 1 This is working with 1.4.9 Link to comment Share on other sites More sharing options...
marcelo365 Posted February 25, 2013 Share Posted February 25, 2013 where u get that? where i can find? admintracking.php thanks for helping Link to comment Share on other sites More sharing options...
Maheshmohan1093 Posted November 3, 2015 Share Posted November 3, 2015 SELECT `ps_product_shop`.`id_product` , `ps_product_shop`.`active`,`ps_product_lang`.`name`FROM `ps_product_shop`INNER JOIN `ps_product_lang` ON `ps_product_shop`.`id_product`=`ps_product_lang`.`id_product`LEFT JOIN `ps_image` ON `ps_product_shop`.`id_product` = `ps_image`.`id_product`WHERE `ps_image`.`id_product` IS NULLAND `ps_product_shop`.`active` =1AND ps_product_shop.id_category_default NOTIN ( 2 ) The above query should work in PS1.6 version. Please replace ps with your DB-prefix. This will retrieve the id of the product, product name and its status which is not having images in the Web. Link to comment Share on other sites More sharing options...
telefonino Posted December 4, 2015 Share Posted December 4, 2015 Sorry for the stupid question - but where do I find the DB-prefix? Link to comment Share on other sites More sharing options...
Maheshmohan1093 Posted December 9, 2015 Share Posted December 9, 2015 You can find your DB-prefix in your database where all tables will be having a prefix with something like ps_tablename. Link to comment Share on other sites More sharing options...
razvy Posted March 30, 2017 Share Posted March 30, 2017 This is an incredible tool for finding products with no images at all. Can it be changed so it could show all the products that have broken images? I have lots of products with broken images due to errors during image import... and it's impossible to find them one by one. IE: the product has 5 images, one of them is ok and the rest are just showing questin marks. Link to comment Share on other sites More sharing options...
Black RL Posted March 26, 2018 Share Posted March 26, 2018 (edited) This is an old thread but I had a similar problem with product cover image, here's an adaptation to find products without cover: SELECT * FROM ps_image WHERE cover IS NULL AND position = 1 Note that you might have to change position = 1 to 2, 3 or other depending on your setup, you might also try without that line: SELECT * FROM ps_image WHERE cover IS NULL But this might not be the best solution if you have multiple images per product, because this will return all images that are not flagged as cover. Note: note that you have to substitute ps_ with your table prefix Edited March 26, 2018 by Black RL (see edit history) 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