devsharp Posted September 11, 2014 Share Posted September 11, 2014 Hi All, I just wants to hide all products of my store which haven't images automatically.you may suggest hook module or custom method for it.Thanks in advance.David Link to comment Share on other sites More sharing options...
Kimi Posted September 11, 2014 Share Posted September 11, 2014 UPDATE ps_product set active = 0 where id_product not in (select distinct id_product from ps_image); UPDATE ps_product_shop set active = 0 where id_product not in (select distinct id_product from ps_image); 1 Link to comment Share on other sites More sharing options...
devsharp Posted September 11, 2014 Author Share Posted September 11, 2014 Thanks for your quick response kimi.I appreciate it but i am new with prestashop and wants to know how could i modify my store that whenever i upload a product without any image it will never display that on front office. Link to comment Share on other sites More sharing options...
Kimi Posted September 11, 2014 Share Posted September 11, 2014 Thats not that easy, you would need edit code of Product.php Link to comment Share on other sites More sharing options...
El Patron Posted September 11, 2014 Share Posted September 11, 2014 actually you would need move changes to lower level, hiding a product at product.php level, the product would still be counted by category list and pagination. it's a slippery slope maybe better to change '?' image too some better default image ? Link to comment Share on other sites More sharing options...
devsharp Posted September 11, 2014 Author Share Posted September 11, 2014 Thanks for response EI Patron,Actually i am agree with you but wants to know is there any possible method to do so (hide products which haven't images).And i wants to hide them completely from front office.Do i need to develop a module for it, customization or any possible method help will be appreciated.Thanks in advance. Link to comment Share on other sites More sharing options...
El Patron Posted September 11, 2014 Share Posted September 11, 2014 you should look for method to 'disable' from back office. this way no-native prestashop is hacked. it would be similar logic to disable when out of stock... there a bunch of these? Link to comment Share on other sites More sharing options...
Kimi Posted September 11, 2014 Share Posted September 11, 2014 made it for functions getting products from classes Product and Category, maybe there are more but the change should be similar: https://github.com/mittermichal/HideProductsWithoutImages/commit/85784bffe2e89dff190b11d7714c26d12daf30c9 Link to comment Share on other sites More sharing options...
devsharp Posted September 13, 2014 Author Share Posted September 13, 2014 I have tried the same way at all, but no success. i am on Prestashop 1.6.0.9. Link to comment Share on other sites More sharing options...
PascalVG Posted September 13, 2014 Share Posted September 13, 2014 If your host allows triggers: Maybe make a trigger of the UPDATE lines of Kimi in #2. That way every time you save/modify the product it would check if there's an image... Example of something similar is done here: http://www.prestashop.com/forums/topic/248566-tutorial-how-to-automatically-disable-out-of-stock-products/ My 2 cents, pascal. Link to comment Share on other sites More sharing options...
Recommended Posts