Only showing products that are in stock

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

By CommonSenseDesign - July 16, 2014

I have a page that I produced for a client some time ago, which shows plants and flowers in various categories: e.g. http://www.colourparadise.com/plantsSubcategory.php?main_category=13. I've added a new drop down menu - called "availability" - in CMSB so they can choose if a product is "In Stock Now" or "Unavailable". Is it possible to show in the bullet list only the plants where "In Stock Now" has been selected?

This is the code that displays the bullet list:

    <ul><?php foreach ($product_detailsRecords as $detailRecord): ?>
     <li>
       <a href="<?php echo $detailRecord['_link'] ?>"><?php echo $detailRecord['title'] ?></a>
             <?php endforeach ?>
          
              <?php if (!$product_detailsRecords): ?>
       </li>
    <?php endif ?></ul>

Attachments:

plantsSubcategory.php 7K

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".