<?php if(have_posts()) :?>
<?php while(have_posts()) : the_post();?>
<?php wc_get_template_part('content','product');?>
<?php endwhile;?>
<?php else :?>
<div>Товаров не найдено</div>
<?php endif;?>
get_header();
$args = array(
'post_type' => 'product',
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'field' => 'slug',
),
),
'posts_per_page' => -1,
);
global $wp_query;
$wp_query = new WP_Query( $args );
print_r($wp_query);
if ( $wp_query->have_posts() ) :
?>
<?php woocommerce_product_loop_start(); ?>
<?php while( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<?php wc_get_template_part( 'content', 'product' );?>
<?php endwhile; ?>
<?php woocommerce_product_loop_end(); ?>
<?php else : ?>
<div>Товаров не найдено</div>
<?php endif; ?>
get_footer();