<?php
defined('ABSPATH') || exit;

if (!class_exists('WooCommerce')) {
    return;
}

$sale_products = wc_get_products(array(
    'limit' => 8,
    'orderby' => 'date',
    'order' => 'DESC',
    'status' => 'publish',
    'on_sale' => true
));

if (empty($sale_products)) {
    return;
}
?>
<!-- start list products offer discount -->
<section class="mt-8 elementor-widget elementor-widget-woocommerce-products">
    <?php get_template_part('template-parts/woocommerce', 'discount-products', array('products' => $sale_products)); ?>
</section>
<!-- end list products offer discount -->


