The cycle is, in general, the usual WordPress, given that the type of post - products , and not categories, but taxonomies. Product properties (for example, sales price) are contained in the meta-fields.
For the test, an empty page was created using the template file. In the template file:
<?php /* Template Name: woo-test-632707 */ echo '<h2>Товары категории "Фильмы"</h2>'; $args = array( 'post_type' => 'product', 'product_cat' => 'фильмы', 'posts_per_page' => -1 ); $wc_query = new WP_Query($args); if ($wc_query->have_posts()) { while ($wc_query->have_posts()) { $wc_query->the_post(); ?> <p><?php the_title(); ?></p> <?php } wp_reset_postdata(); } else { ?> <p><?php echo 'No Products'; ?></p> <?php } echo '<h2>Товары на распродаже</h2>'; $args = array( 'post_type' => 'product', 'meta_key' => '_sale_price', 'meta_value' => '0', 'meta_compare' => '>=', 'posts_per_page' => 12 ); $wc_query = new WP_Query($args); if ($wc_query->have_posts()) { while ($wc_query->have_posts()) { $wc_query->the_post(); ?> <p><?php the_title(); ?></p> <?php } wp_reset_postdata(); } else { ?> <p><?php echo 'No Products'; ?></p> <?php } ?>
The result is here .