So I have tons of products being displayed through my custom post type of
products made by the '
Advanced Custom Field' and
'Custom Post Type UI' plugins. I made a very simple custom field named "stock" which is a checkbox and if true then the word "Out of Stock" is echoed next to the product, nothing to crazy very simple.
Example of how this is done:
<?php if (get_field('stock')): ?> <div class="stock"><p>Out of Stock</p></div><!--out of stock--> <?php endif; ?>
Now my question here is how can I have a list or display all of my products that have the field "Stock" set to true so that I can determine which ones I have set out of stock and not have to go through 1000 products to see which one I set out of stock.
So lets say out of 1000 products you have 100 out of stock. There is no way that by memory you will remember each 100 items you set out of stock. How can I see a list of the ones I set out of stock meaning the products that have
<?php get_field('stock') = true ?>
Also my products are being displayed through a regular while loop, looping through all my products to be displayed in my taxonomy.php like so:
<?php while( have_posts() ) : the_post(); ?> //looping products <?php endwhile; ?>