Answer the question
In order to leave comments, you need to log in
How to add class to array of woocomerce products?
<?php
$args = array (
'post_type' => 'product',
'posts_per_page' => -1,
'meta_query' => array(
array(
'value' => $_GET['type'],
'compare' => 'like'
),
),
);
global $woocommerce, $woocommerce_loop;
$products = new WP_Query( $args );
if ( $products->have_posts() ) { ?>
<?php woocommerce_product_loop_start(); ?>
<?php while ( $products->have_posts() ) : $products->the_post(); ?>
<?php woocommerce_get_template_part( 'content', 'product' ); ?>
<?php endwhile; // end of the loop. ?>
<?php woocommerce_product_loop_end(); ?>
<?php }
else echo'<h2>К сожалению в наличии нету шин подходящего типоразмера</h2>';
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question