<?php 
$led_tv_our_product = get_theme_mod('led_tv_our_product_setting', true);
  
if ($led_tv_our_product !== false) {
  $led_tv_our_product_short_heading = get_theme_mod('led_tv_our_product_short_heading');
  $led_tv_our_product_heading = get_theme_mod('led_tv_our_product_heading');
?>
<section id="best-seller-section" class="py-5">
  <div class="container">
    <?php if ($led_tv_our_product_short_heading) : ?>
      <div class="border-heading text-center text-md-start">
        <h5 class="mb-3"><?php echo esc_html($led_tv_our_product_short_heading); ?></h5>
      </div>
    <?php endif; ?>
    <?php if ($led_tv_our_product_heading) : ?>
      <h3 class="mb-5 text-center text-md-start"><?php echo esc_html($led_tv_our_product_heading); ?></h3>
    <?php endif; ?>

    <?php if (class_exists('woocommerce')) : ?>
      <div class="row">
        <?php
        $led_tv_args = array(
          'post_type'      => 'product',
          'posts_per_page' => 10,
          'product_cat'    => get_theme_mod('led_tv_our_product_product_category','product_cat1')
        );
        $loop = new WP_Query($led_tv_args);
        while ($loop->have_posts()) : $loop->the_post();
        ?>
          <div class="col-lg-3 col-md-6 col-sm-6 wow fadeInUp" data-wow-delay="0.5s">
            <div class="product-box mb-5">
              <?php global $product; ?>
              <div class="product-image">
                <?php echo woocommerce_get_product_thumbnail(); ?>
                <div class="product-sale">
                  <?php woocommerce_show_product_sale_flash($post, $product); ?>
                </div>
              </div>
              <div class="product-content">
                <h4><a href="<?php the_permalink(); ?>"><?php echo esc_html(get_the_title()); ?></a></h4>
                <p><?php echo $product->get_price_html(); ?></p>
                <p class="sale_cart mb-0">
                  <i class="fas fa-shopping-basket me-2"></i><?php if ($product->is_type('simple')) {
                  woocommerce_template_loop_add_to_cart($loop->post, $product);
                } ?>
                </p>
              </div>
            </div>
          </div>
        <?php
        endwhile;
        wp_reset_postdata();
        ?>
      </div>
    <?php endif; ?>
  </div>
</section>
<?php } ?>
