Hiding out of stock products Free PrestasShop module.
Set the "Visibility" option of out of stock products to "Nowhere" to hide them on the front office. For some shops, it doesn't make sense to show out-of-stock products on the front office, this free prestashop module is an easy solution to hide out of stock products on the front office.
Features
- One click to set the "Visibility" option to "Nowhere" for all out of stock products.
- Do a check on the order confirmation page, to set out of stock products in the current order to "Nowhere" to make out of stock products not show out on the front office.
- Do another check on the back office product page, set the "Visibility" back to "Everywhere" when products are back to stock.
Compatibility
- PrestaShop 1.6 and PrestaShop 1.7.
- Transformer theme, Panda theme, Classic theme and all other themes.
How to install and upgrade.
How to install? Use the "Upload a module" button on "BO > Modules" page to install the module.
How to upgrade?
Use the "Upload a module" button on "BO > Modules" page to upload the new version to your site, it's the same as how to install, don't worry all your data will be safe, prestashop will just upload updated files to your site, it won't reinstall this module.
How to get support.
If you have any questions with the module, post them out on the prestashop module support forum, we'll help you out.
Documentation.
NO.
Currently NO.
Changelog
v1.0.1 (31 October, 2018) Fixed a bug.
v1.0.2 (28 February, 2019) Added a feature to set the "visibility" back to "Everywhere" when products are back to stock, the feature will run automatically when you make changes on the back office product page.
v1.0.3 (16 April, 2019) Added a button to manually set the "visibility" back to "Everywhere" for products are back to stock.
v1.0.4 (28 April, 2019) Fixed the problem of setting the "visibility" back to "Everywhere" not working correctly when a product is re-stocked.
I will keep upgrading this module, let me messages, if you have feature requests.
[NEWS] Advanced hiding out of stock products module is available.
Check it here Advanced hiding out of stock products module for PrestaShop, it has more features than this free one, like
- List all out-of-stock products out.
- List all products which are in Nowhere out.
- Email notification.
- Cron job.
- Automatically clear the smarty cache to make sure out of stock products be hidden immediately.
Very nice post!! This article explains. The article on this site is full of useful information for anyone interested in the free PrestaShop module. Every step for installation is defined in this post. Thank you for sharing this useful information with us.
I've just installed the module, but the configure screen only displays "General" and "About" tabs. It also mentions in General that 1 product is out of stock, whereas I have 9. What can I do to access the features properly?
Much appreciated.
The module doesn't have any settings, it will start to run once it's installed.
I guess the stock of some of your products is probably less than 0, if yes, redownload the module to upgrade your current one to v1.0.5
Hi,
I installed the module on my website but it hides the products everywhere, there is no option to hide them only on homepage. And on homepage where I had "best selling products" it does not replaced the out of stock products with in stock products, just hides the out of stock products.
Is there any option to make it work only on homepage?
For some sections on homepage like "best selling products" is there an option to show same amount of products like before hiding the products out of stock? For example for "best selling products" I have listed 7 products, from witch 3 are out of stock, now are listed only 4 products but I want to be listed 7 products that are in stock.
And now the problem that I have, after deactivating the module out of stock products are still hidden. Is there a way to make them visible again?
Raul
Very good questions.
1. No option to hide out-of-stock products on homepage only. When a product is set to "Nowhere", the product won't show out anywhere on the front office.
2. I can't produce the problem. I can think of two reasons of you got that result. a) You just had 7 best sellers. b) The smarty cache wasn't cleared.
3. You can find them and set their "Visibility" fields back to "Everywhere" manually. Another solution is using the Advanced version of this module, it can list all out of stock products out, you can set them back to "Everywhere" by one-click, like this
Hi Jonny. Thanks for the module. I'm using PrestaShop 1.6.1.23 and 1.0.4 version of this module.
It works fine when I use the link in the module config page but for some products, if I want to change the visibility of a product manually, it won't apply the changes (it will show the message that it saved successfully but if you check it again, it's still on "Anywhere")
If I disable the module, it works fine and I can change the visibility.
One more thing, for some products I'm using pack feature and adds some of my products to it. I set the quantity to 1 for that pack and if one of those products which are in that pack, got out of stock, this pack will be shown as out of stock too (still has 1 qty)
In frontoffice, it will be shown as out of stock but in BO it has quantity so this module can't recognize it (that's why I have to set them Nowhere manually)
Thanks.
1. Then you can use the Advanced version of this module which changes the visibility setting only when the stock information is changed. For example if a product has 10 in stock, you can manually set its visibility to "Nowhere", the Advanced version of this module won't force the visibility back to "Anywhere".
2. About the Pack product, accordion to your description I guess you just need to change the "Pack quantities" setting to "Decrement both".
Hi!
It's posibol know the products out of stock before hide them?
Thank you Jonny
Two solutions for you.
1. Use the advanced version of this module, it can send an email notifications to you, when a product is out of stock and being hidden.
2. Use the PrestaShop's mail alter module, it can send email notifications when a product's stock is under a certain amount.
Hi!
I will try the second if it don't function properly I will try the advanced version.
Thank you so much!
Hi
First of all, thank you for sharing such a module.it's really a very useful module, but if it is developed at some points it will be amazing.
I have prepared a small cron code to do the job of hiding the out of stock product.I want to write this code here, maybe because it might help someone.
****CODE*****
setVisibilityToNone($module->getOutOfStockIds());
echo 1;
****CODE*****
First, create a php file named "cron-stoutofstocktonowhere" and paste the following code into this file and drop it into public_html. And open the url as "https: // your web site.com/cron-stoutofstocktonowhere.php"
this will automatically hide the products that are out of stock. you can set this file as a cron task.
There are some errors in the module.I want to write these errors here. I'm sure Johnny will find a solution to these mistakes.
I'm using prestashop 1.7.5.0.
1->The module does not automatically set the product to "everywhere" again when there is a re-stock entry to any combination in the module combination products. So, in combination products again "everywhere" feature does not work.
2->When the product stock is set to 1 or more in the product page and the save button is pressed, this module does not set the product to olarak "everywhere" . But the second time the "save" button is clicked the module is running and the product "everywhere" is set.
This means that the için save feature must be triggered twice to make the product entering the stock "visible" again.
If these errors are resolved, it will become a truly excellent module.
Johnny, I hope you're interested in that.
Thank you for your interest
Sorry, The code does not look exactly above.
https://codepen.io/anon/pen/vMEdvG please get the complete code from the "html" field in this link.
I've fixed the problem of setting the "visibility" back to "Everywhere" not working correctly when a product is re-stocked.
Hi Jonny
thanks for your interest.Currently working seamlessly.
but i heard the need to do a cron task for this module. in this way I get a healthier result.
I'm adding Cron codes here in case there's someone in need.
php file cron codes to hide out of stock product: https://codepen.io/anon/pen/vMEdvG
php file cron codes to set the visible product: https://codepen.io/anon/pen/ROdVjo
Jonny maybe you can add a cron url to the module 🙂
Regards
Thanks for reporting those errors, if they do exist, I will soon fix them.
Such a great idea... would you be updating this module anytime soon to include option to automatically set the “Visibility” option to “Visible” when product back in stock again?
I will soon add the feature.
Hello
I used this module and my out of stock products are not viewed on my shop now...but now I want to view my out of stock products on my shop (undo this module did). How can I do this?
I find it...on {database}_product_shop manual change on visibility column to "both"
See this pic. https://www.sunnytoo.com/wp-content/uploads/screenshot/Screenshot00859.jpg
Hi Jonny
we have a lot of products that in periods of time are sold and be available for sale again by recharging. so it is necessary to set automatically visibility option to "anywhere" when they have been recharged. can the module do this after recharging? or can you add this option to module?
That's a nice suggestion, thanks, I will add the feature in the next update.
Hi, When a product is stock, is module set the “Visibility” option of stock products to “anywhere”?
Currently no, need to manually set the "Visibility" option to "Visible" when add stock to a product.