Only showing products that are in stock

4 posts by 2 authors in: Forums > CMS Builder
Last Post: July 17, 2014   (RSS)

By claire - July 16, 2014

Have you got anything in the products table to mark whether a product is in stock or not? A checkbox perhaps?

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By CommonSenseDesign - July 16, 2014

Hi, Clare.

I used a drop down menu, not a checkbox. The two options in the drop down are "In Stock Now" or "Unavailable".

By claire - July 17, 2014

That works too.

So this means rewriting some of the PHP to allow the search. See the file I uploaded, and the code I added at lines 36 and 141.

This adds a conditional chunk to the getRecords function that gets the products, and I've included a few header links to swap between them. It might not work if I've got the variable names wrong.

Take a look and let me know what you think.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Attachments:

plantsSubcategory.php 8K