«

»

May 14

OpenCart 2.0.2.0 hide out of stock items solution

Somehow this basic functionality still missing in current opencart release (2.0.2.0). So I had to look for solution and found one on the opencart forum.
There is also extension available already, so I’ve downloaded it and really disliked idea of replacing original files.
Since we already have built-in customization solution such as OCMOD.
So I’ve took the best part of this code and wrote simple and straightforward modification extension in OCMOD format.
This extension replaces all matches in catalog/model/catalog/product.php file of following string:

p.date_available <= NOW()

with

p.date_available <= NOW() AND p.quantity >= 1

Succesfully removing out of stock products from buyer attention, but leaving it available from admin console.
Extension available for download from opencart.com.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>