<?php 
$expert_sports_coach_aboutus = get_theme_mod('expert_sports_coach_our_products_show_hide_section', '1');

if ($expert_sports_coach_aboutus == '1') {
?>
<section id="product-section" class="py-5 px-md-0 px-3">
  <div class="container">
    <?php
    $expert_sports_coach_our_products_heading_section = get_theme_mod('expert_sports_coach_our_products_heading_section');
    ?>
    <?php if ($expert_sports_coach_our_products_heading_section != '') { ?>
      <h2 class="mb-4 text-center text-capitalize product-heading">
        <?php echo esc_html($expert_sports_coach_our_products_heading_section); ?>
      </h2>
    <?php } ?>
    <?php if (class_exists('woocommerce')) : ?>
      <div class="row">
        <?php
        $expert_sports_coach_selected_category = get_theme_mod('expert_sports_coach_our_product_product_category','product_cat1');
        if ($expert_sports_coach_selected_category) {
            $expert_sports_coach_args = array(
                'post_type'      => 'product',
                'posts_per_page' => 50,
                'product_cat'    => $expert_sports_coach_selected_category,
                'order'          => 'ASC'
            );
            $expert_sports_coach_loop = new WP_Query($expert_sports_coach_args);
            while ($expert_sports_coach_loop->have_posts()) : $expert_sports_coach_loop->the_post();
            global $product;
        ?>
          <div class="col-lg-3 col-md-4 mb-5 wow bounceIn" data-wow-delay="0.5s">
            <div class="product-box">
              <div class="product-image">
                <?php echo woocommerce_get_product_thumbnail(); ?>
              </div>
              <div class="product-content text-start">
                <h3 class="my-3"><a href="<?php the_permalink(); ?>"><?php echo esc_html(get_the_title()); ?></a></h3>
                <div class="product-rating">
                  <?php
                  if ($product->is_type('simple')) {
                      woocommerce_template_loop_rating();
                      $expert_sports_coach_review_count = $product->get_review_count();
                      if ($expert_sports_coach_review_count > 0) {
                          echo ' <span class="review-count">(' . esc_html($expert_sports_coach_review_count) . ' ' . esc_html(_n('Review', 'Reviews', $expert_sports_coach_review_count, 'expert-sports-coach')) . ')</span>';
                      }
                  }
                  ?>
                </div>
                <p class="mb-2 product-price"><?php echo $product->get_price_html(); ?></p>
                <div class="cart-button">
                  <?php if ($product->is_type('simple')) { woocommerce_template_loop_add_to_cart(); } ?>
                </div>
              </div>
            </div>
          </div>
        <?php
            endwhile;
            wp_reset_postdata();
        }
        ?>
      </div>
    <?php endif; ?>
  </div>
</section>
<?php } ?>