<div id="on-sale" class="content active" aria-hidden="false">
<div class="sales-products">
<?php
global $product;
$id = $product->id;
$args = array('post_type' => 'product',
'meta_query' => array(
'relation' => 'OR',
array( // Simple products type
'key' => '_sale_price',
'value' => 0,
'compare' => '>',
'type' => 'numeric'
),
array( // Variable products type
'key' => '_min_variation_sale_price',
'value' => 0,
'compare' => '>',
'type' => 'numeric'
)
)
);
query_posts( $args );
while ( have_posts() ) : the_post();
echo '<ul>';
echo '<li class="thumbnail">';
the_post_thumbnail('category-thumb');
echo '</li>';
echo '<li class="title">';?>
<a href="<?php the_permalink();?>"><?php the_title();?></a>
<?php echo '</li>';
echo '<li class="item-number">';
echo 'Item Number :'.get_post_meta( $id, 'item_number', true );
echo '</li>';
echo '<li class="">';
echo 'SKU Code : '.$product->get_sku();
echo '</li>';
echo '<li class="stock">';?>
<?php envy_stock_catalog();
echo '</li>';
echo '<li class="comments">';?>
<a href="<?php the_permalink();?>">View Comment</a>
<?php echo '</li>';
echo '<li class="price">Price :';
echo do_shortcode('[add_to_cart id="'.$id.'"]');
echo '</li>';
echo '</ul>';
endwhile;?>
</div>
<?php the_posts_pagination( array(
'prev_text' => __( 'Previous page', 'twentyfifteen' ),
'next_text' => __( 'Next page', 'twentyfifteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
) );
?>
</div>