query->get_meta_query(); $args = array( 'post_type' => 'product', 'stock' => 1, 'posts_per_page' => 8, 'orderby' => 'date', // Order by date to get the latest products first 'order' => 'DESC', // Show the latest products first 'meta_query' => $meta_query, ); $loop = new WP_Query( $args ); if($loop->post_count > 0){ while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>

get_sale_price(); if ($sale_price) { echo '' . wc_price($sale_price) . ''; } $regular_price = $product->get_regular_price(); echo '' . wc_price($regular_price) . ''; ?>