Danman Posted February 2, 2012 Share Posted February 2, 2012 This have been a highly requested feature for years on the Prestashop community and I think it´s finally time for the Prestashop-team to implement it in 1.5. The ability to automatically disable and not to show out-of-stock products is so essential in many buisness-models. Ex. If you have one-off products. Many products- a lot of work to manually disable all the out-of-stock products. You want to sell what have in stock and NOT out-of-stock products. Customers who like an out-of-stock product that shows in Prestashop tends not to buy your other products that you have in stock! I have looked att 5-6 other e-commerce systems and Prestashop is the ONLY one that dont have this feature. So please this would be a big improvement of Prestashop. Link to comment Share on other sites More sharing options...
Raphaël Malié Posted February 3, 2012 Share Posted February 3, 2012 Hello Danman, I transmit your request to the developper in charge of stock management to see if it's possible to add this in 1.5. Anyway feature request is now frozen on 1.5, so if its too complicated to add it now you will need to wait a bit more (1.5.1 or 1.6). Thank you anyway, in my opinion this is a must have feature and I hope this won't be too complicated to add Regards 1 Link to comment Share on other sites More sharing options...
Danman Posted February 3, 2012 Author Share Posted February 3, 2012 Hello Raphael, Thank you for your quick reply. I and many others really hope you have succes in getting this feature added to Prestashop. This would will make Prestashop even greater. Regards Danman Link to comment Share on other sites More sharing options...
shoulders Posted February 3, 2012 Share Posted February 3, 2012 just incase it is not to late. I really want this feature. I think it one of the most requested features. I am surprised that it was not put in ages ago. please can we have this, even if 1.5 is delayed a little more. This one is worth it. ie antique ring shop. most of the rings will be unique and never to be sold again. all the best shoulders 1 Link to comment Share on other sites More sharing options...
Pippo3000 Posted February 8, 2012 Share Posted February 8, 2012 +1, would love to see such an option as well to hide products out of stock Link to comment Share on other sites More sharing options...
Raphaël Malié Posted February 8, 2012 Share Posted February 8, 2012 Hello, it seems that this feature was already requested recently, sadly we can't add it for the current 1.5 version ... But it's probably possible to developp it as a module with hooks inside stock management Regards Link to comment Share on other sites More sharing options...
Paul / 01media Posted February 8, 2012 Share Posted February 8, 2012 Hi shoulders, I like this idea as well. But this shoud be a standard module with settings how to act when an item is out of stock/s. Those settings should be global and on product level. Also imagine having several stocks (warehouses). And one shop could ship from all warehouses.How to handle it in that case? And some products may be only temporary out of stock, customers should be able to pre-order them even when out of stock. Other products may never come back to stock (outgoing, old products). A modul capable of handling all those settings and cases would be very welcome. Link to comment Share on other sites More sharing options...
shoulders Posted February 11, 2012 Share Posted February 11, 2012 this should be part of the core from my point of view. i dont understand why you would need a module (but i am not a programmer). it would be annoying to install a module for this or deal with question on how to turn it on etc.. however having the feature as a module rather that not having it would be a major plus. maybe this could be sneaked in to a later realease of 1.5 as it is a major missing feature along with multiple image uploading (see my signature, include that if you want) and postcode handling of addresses (see my signature for research on the UK and an appropriate sql script) tar Link to comment Share on other sites More sharing options...
sbm Posted August 19, 2012 Share Posted August 19, 2012 Hello All, I want this too. Somebody knows how to do it?? Regards, Steven Link to comment Share on other sites More sharing options...
Trip Posted August 20, 2012 Share Posted August 20, 2012 (edited) Hi there, for the PS versions <= 1.4.8 is quite simple. Make a folder in your modules dir and name it like you want. Than create a php file in it with the following code: <?php include(dirname(__FILE__).'../../../config/config.inc.php'); include(dirname(__FILE__).'../../../init.php'); $products = Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET active=0 WHERE quantity=0'); die ('OK'); ?> Just an example snippet, use at your own risk and modify to your needs! When you trigger the script via cronjob it will set all products with quntity 0 to inactive. Best regards, trip Edited August 21, 2012 by Trip (see edit history) 1 Link to comment Share on other sites More sharing options...
sbm Posted August 20, 2012 Share Posted August 20, 2012 Hello Trip, Thanks for your advice. I added the file and folder on Modules: /modules/hideoutofstock/hideoutofstock.php with content. <?php include(hideoutofstock(__hideoutofstock.php__).'/../../config/config.inc.php'); include(hideoutofstock(__hideoutofstock.php__).'/../../init.php'); $products = Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET active=0 WHERE quantity=0'); die ('OK'); ?> I have a cron job created like this: wget -q --spider "http://www.mysite.com/modules/HideOutOfStock/HideOutOfStock.php" 2>&1>dev/null , which I already run But out of stock items are still online, look: mysite What am I doing wrong???? Thanks a lot! Steven Link to comment Share on other sites More sharing options...
Trip Posted August 20, 2012 Share Posted August 20, 2012 Hi Steven, I don't know what is wrong. I've the script running now for 2 years. Did you test it just by calling the url manually? Anyway. This is my workaround there are better ways to implement it. You can do whatever you want with it but I can not give warranty nor can I give support for it. Best regards, trip Link to comment Share on other sites More sharing options...
sbm Posted August 20, 2012 Share Posted August 20, 2012 Hi Trip, So I wrote correctly everything? They way of putting the folder and file names is correct? Regards, Steven Link to comment Share on other sites More sharing options...
shoulders Posted August 20, 2012 Share Posted August 20, 2012 @sbm - check your syntax, check that the cron job is running and finishing properly, check permissions on the file @Trip, i love the work around, you learn something everyday Link to comment Share on other sites More sharing options...
Trip Posted August 21, 2012 Share Posted August 21, 2012 Thx shoulders, I will see if I can pack it in a module or something as soon as 1.5. is out. I have not dived into the code so far and maybe with the advanced stock management it is getting more complicated. I do not have product combinations and stuff so as I said, modify and test it on your test system. For me it works fine and I just wanted to show that it is no rocket science to implement it. Best regards, trip Link to comment Share on other sites More sharing options...
tdr170 Posted August 21, 2012 Share Posted August 21, 2012 Funny thing here is I see no reason to hide out of stock products, as I have my store set to not allow orders of out of stock products and that disables the add to cart button. When a product is out of stock a customers can enter their email address and be notified when product is back in stock for myself that is perfect. If a product that is out of stock were disabled to the point where it did not show the customer would most likely just think you did not carry it and move on to another store. With the Email notification of out of stock products the customers most likely will return to purchase at another time and not just figure you don't carry that item. Just my thoughts. Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 21, 2012 Share Posted August 21, 2012 I would think that tdr170's suggestion would make the most business sense. Link to comment Share on other sites More sharing options...
Trip Posted August 22, 2012 Share Posted August 22, 2012 Valid point, but when you have 3000 products and let's say 70% are sold out than it might not raise confidence to the customer. Also people may have lot's of unique products so there are scenarios and you are free to trigger the feature whenever you want to clean up your store. I like the backend of ps but I had to program some extra modules like an ajax driven product mass updater because when have to work with the software on a daily basis then you really understand what features are lacking. I do not want to spent hours a day updating my stock when I can achieve this in seconds. There is a difference between theory and reality and I do not expect developers to know that but we are the ones who are working with the software and I think, know better what we need or not. Best regards, trip 3 Link to comment Share on other sites More sharing options...
tdr170 Posted August 22, 2012 Share Posted August 22, 2012 I am no developer just a user just like you and I understand that there may be times that this could be used as long as it is easy to change from on to off. However I still believe in showing all products in stock or not as an avid internet shopper I like to know what is available and where. Lets say I was looking for widgets and a search brought up your site but I could not find them I would not return to your site the next time I needed one, however if I found it and it was out of stock I might email you to find out the status of restocking or return at another time when I needed more widgets. We all have different ideas and opinions and by mixing them all together we all end up better off. Once again just my thought on this subject. Link to comment Share on other sites More sharing options...
Trip Posted August 22, 2012 Share Posted August 22, 2012 Yepp, 2 years ago I had the situation that maybe 30 percent of my products where sold out. When these are unique items it is tedious to disable them all by hand and customers might think that the shop is not maintained anymore. I heard of shops managing 40 or 50 thousand products. I have better things to do than switching the availability off all day long. When a unique product is sold out why should I leave it online? I do not say everybody needs it or should use it but I do not understand all the discussion like we can not implement it in 1.5. and so on because it is just a few lines of code. Maybe it would be an enhancement to code a script that disables every product which is unavailable for a given time e.g. 1 month. Maybe I will do something like that when I have the time. Best regards, trip Link to comment Share on other sites More sharing options...
sbm Posted August 23, 2012 Share Posted August 23, 2012 Well, tdr170 has a point, isn´t he? From my point of view it can be frustrating finding too many out of stock items. On the other hand we can lose many customers who are willing to wait, or maybe buy something similar instead, if they dont find what they were looking for originally. Food for thought..... Link to comment Share on other sites More sharing options...
shoulders Posted August 24, 2012 Share Posted August 24, 2012 (edited) I would think that tdr170's suggestion would make the most business sense. for him. not all shops have the same business models. I have one client who sells antique rings and jewellery. These items are all unique, once they have been sold there will be no more. So she definately wants to disable these items when they have been sold and to have this process automatic. I believe that this festure is as important as an easy upgrade process. If it is an option you can turn it on or off to suit your needs. Edited August 24, 2012 by shoulders (see edit history) 2 Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 28, 2012 Share Posted August 28, 2012 Hello Shoulders, Yes, actually you are very right, Every single merchant would have their own short term and long term goals that will definitely vary on what kind of product they are selling. This would change the way they do business and change the way their Back Office Settings are configured. Link to comment Share on other sites More sharing options...
musicmaster Posted August 28, 2012 Share Posted August 28, 2012 I was wondering whether that line "$products = Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET active=0 WHERE quantity=0;" can't be run after each order. Add a simple flag to enable it and the mod is ready. Just my little two cents... Link to comment Share on other sites More sharing options...
Nick Fedchik Posted August 29, 2012 Share Posted August 29, 2012 I was wondering whether that line "$products = Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET active=0 WHERE quantity=0;" can't be run after each order. Add a simple flag to enable it and the mod is ready. Just my little two cents... Agree it's a good feature, but now the developers only fix a bugs, they do not do any improvements. And it's a good way - let they release a stable 1.5 product, then add any improvements. I also post some improvment proositions, warehouse reordering is one of them. Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 29, 2012 Share Posted August 29, 2012 Hello Nick, thanks for the message. If you do find any bugs, we would love it if you posted them to forge.prestashop.com this way you as well as PrestaShop can track the improvements or fixes made for any bugs or other issues. Thank you for choosing PrestaShop! Link to comment Share on other sites More sharing options...
Danman Posted November 28, 2012 Author Share Posted November 28, 2012 Any update about this feature? I think it´s substandard of Prestashop not to have it as standard in the basic settings..... 1 Link to comment Share on other sites More sharing options...
btek Posted November 30, 2012 Share Posted November 30, 2012 Why in prestashop we must manualy do this work. 1 Link to comment Share on other sites More sharing options...
davidtaubmann Posted December 16, 2012 Share Posted December 16, 2012 (edited) I used this template-level solution and is EXCELENT for me. http://www.prestasho...stock-products/ It even hides products that have combinations and there is none in stock for any combination! Edited December 16, 2012 by davidtaubmann (see edit history) Link to comment Share on other sites More sharing options...
AndyLaci Posted April 2, 2013 Share Posted April 2, 2013 I used this template-level solution and is EXCELENT for me. http://www.prestasho...stock-products/ It even hides products that have combinations and there is none in stock for any combination! but there is problem with the pagination! Link to comment Share on other sites More sharing options...
benjamin utterback Posted April 2, 2013 Share Posted April 2, 2013 but there is problem with the pagination! Hi Andy, have you considered putting a post in the "Job Offer" section of the forum? You can find some great help at great prices. Link to comment Share on other sites More sharing options...
envisic Posted May 16, 2013 Share Posted May 16, 2013 I too think this is a major shortcomming in Prestashop. When I started using it didn't even think of the possibility that such option would not be available. To me it's a core functionality that absolutely should be present in such a versatile webshop application. I hope it will be implemented soon, but to be honest it should have been in there by now... 2 Link to comment Share on other sites More sharing options...
vekia Posted May 16, 2013 Share Posted May 16, 2013 I too think this is a major shortcomming in Prestashop. When I started using it didn't even think of the possibility that such option would not be available. To me it's a core functionality that absolutely should be present in such a versatile webshop application. I hope it will be implemented soon, but to be honest it should have been in there by now... you can always set up mysql trigger Link to comment Share on other sites More sharing options...
envisic Posted May 16, 2013 Share Posted May 16, 2013 you can always set up mysql trigger Hmm, I see what the concept of that is.. too bad I have little knowledge of that yet, but I'll try and figure it out. Thanks anyway! Link to comment Share on other sites More sharing options...
shoulders Posted May 17, 2013 Share Posted May 17, 2013 there is a template solution for this which is not ideal but people have some success. I dont have the link but it is on this forum somewhere. Link to comment Share on other sites More sharing options...
envisic Posted May 17, 2013 Share Posted May 17, 2013 there is a template solution for this which is not ideal but people have some success. I dont have the link but it is on this forum somewhere. I've tested the template solution but there's a problem with the number of products on a page. We have a shop with almost exclusively one of a kind products, so it would leave a lot of gaps. I don't think anyone has come up with a solution for the number of items on a page problem? Thanks though. Link to comment Share on other sites More sharing options...
Danman Posted May 17, 2013 Author Share Posted May 17, 2013 I too think this is a major shortcomming in Prestashop. When I started using it didn't even think of the possibility that such option would not be available. To me it's a core functionality that absolutely should be present in such a versatile webshop application. I hope it will be implemented soon, but to be honest it should have been in there by now... You are absolutely right. This have been an issue since the beginning of Prestashop. But the PrestaTeam just don´t get it.... It doesen´t matter how many issuereports, Forge etc. that have been reported over the years. The PrestaTeam just don´t get it! I have given up.... 1 Link to comment Share on other sites More sharing options...
vekia Posted May 17, 2013 Share Posted May 17, 2013 here is a simple mysql trigger which will active/deactive product (when quantity = 0 - deacitive) when quantity >0 - active) CREATE TRIGGER updatestock AFTER UPDATE ON ps_stock_available FOR EACH ROW BEGIN UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0); UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0); END here is a full tutorial about creating this trigger in own prestashop / mysql database: Prestashop trigger to disable out of stock products 2 Link to comment Share on other sites More sharing options...
Trip Posted June 6, 2013 Share Posted June 6, 2013 (edited) Hi there,I am successfully testing this solution here for about 1 month with 1.5.4.XMake a folder in your modules dir and name it like you want. Than create a php file in it with the following code: <?php include(dirname(__FILE__).'../../../config/config.inc.php'); include(dirname(__FILE__).'../../../init.php'); $product_ids = Db::getInstance()->ExecuteS('SELECT id_product FROM `'._DB_PREFIX_.'product` WHERE quantity=0 AND active=1'); foreach ($product_ids as $product_id) { echo $product_id['id_product']."<br>"; $product = new Product($product_id['id_product']); if(($product->hasAttributes()==0) && (Product::getQuantity($product_id['id_product']) <= 0)) { if (!Validate::isLoadedObject($product)) die('error: invalid id'); $product->active = 0; $product->save(); } } die ('OK'); ?> Use at your own risk and modify to your needs! And please test it on a test installation first. I only have simple products without attributes so I could not verify all possible cases When you trigger the script via cronjob it will set all products with quantity 0 to inactive but it ignores products which have attributes.When I first tiggered the script I noticed that few products had errors because of invalid chars so I had to fix the issues first witch was imo a good chance to validate the product objects.Best regards, trip Edited July 30, 2014 by Trip (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 6, 2013 Share Posted June 6, 2013 nice solution but with cron job, with huge number of products, changing rows one by one (foreach loop) consume a lot of RAM Link to comment Share on other sites More sharing options...
Trip Posted June 6, 2013 Share Posted June 6, 2013 Yepp. definetly not a high performance solution but as it uses the PS methods I hope it is a little more bullet proof in case PS team changes something in the db structure. Who knows Link to comment Share on other sites More sharing options...
vekia Posted June 7, 2013 Share Posted June 7, 2013 totally agree with you :-) Link to comment Share on other sites More sharing options...
El Patron Posted August 25, 2013 Share Posted August 25, 2013 We have released module to automatically hide 'Out of Stock' products for 1.4 and 1.5.no core or db changes... Note: if you have the product set to allow order either at the product level or global preferences level the product will not be hidden by our module.EDIT: THIS MODULE IS NO LONGER OFFERED. THANKS Link to comment Share on other sites More sharing options...
kacti Posted April 30, 2014 Share Posted April 30, 2014 We have released module to automatically hide 'Out of Stock' products for 1.4 and 1.5. no core or db changes... Note: if you have the product set to allow order either at the product level or global preferences level the product will not be hidden by our module. Here is the forum link for your review: http://www.prestasho...ions-14-and-15/ Hi The link above to the forum doesn't work? Was there ever a module created to hide out of stock items? Link to comment Share on other sites More sharing options...
El Patron Posted April 30, 2014 Share Posted April 30, 2014 Hi The link above to the forum doesn't work? Was there ever a module created to hide out of stock items? we no longer offer this module. Link to comment Share on other sites More sharing options...
Recommended Posts