A page that displays items in stock based on stock count.
-
Hi, I want to have a page populated by products who’s product count is greater or equal to one not but not based on ‘in stock’ option. I’m not a php developer so am bit lost as to how to construct this. I’ve had a go as below and looking for values that might work. Probably barking up the wrong tree though? I tried usin g ‘allow_backorders’ = ‘yes’ which worked but its not what I want, it has to be based on stock count only. Thanks for any suggestions…
`<?php $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 1000, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘meta_query’ => array(
array(
‘key’ => ‘stock’,
‘value’ => ‘1’,
‘compare’ => ‘>=’
)
)
);
$loop = new WP_Query( $args );
?>’
- The topic ‘A page that displays items in stock based on stock count.’ is closed to new replies.