function last_remaining_products_shortcode() {
$args = array(
'post_type' => 'product',
'meta_query' => array(
array(
'key' => '_stock',
'value' => '2',
'compare' => '<=',
'type' => 'NUMERIC'
)
)
);
$query = new WP_Query($args);
ob_start();
if ($query->have_posts()) {
echo '
- ';
while ($query->have_posts()) {
$query->the_post();
wc_get_template_part('content', 'product');
}
echo '
