Latest Articles
So far this was never an issue, there were problems with uploading modules via the installer because of the ftp connection but you could allways install ocmods without any issue. However, some .. Read More
People had this issue so many times I thought I would write a bit about it. The  types of issues with opencart's 2.x modification system that I identified so far are: 1. Old Vqmod .. Read More
This small tutorial will show you how to manually add custom links to the default top menu in opencart. If you dont want to go trough all the hustle and would like to be able to completly customize.. Read More
To enable seo urls in opencart navigate in admin to system > settings , edit the store and on the server tab of the store settings you will find "Use SEO urls", set it to yes. So far e.. Read More
All Articles

Automatically hide out of stock products in opencart 1.5.6

For out of stock products you can use stock statuses to inform customer that you had that product in stock but you dont anymore, however some merchants would preffer to not display at all the products they dont have in stock, if you wish to do that, here is a simple modification you can do to obtain it.

Edit the file catalog/model/catalog/product.php and inside it seach for the code:

pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1'

You will find it 3 times, and each time replace it with the code:

pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.quantity > '0'

Then save the file and done, your out of stock products will not display anymore.

If you use vqmod and do not wish to edit your core file just download this vqmod from here , drop the xml file from the archive in your store's vqmod/xml folder and you obtained the modification even faster.

Posted by Flo