    <?php
/**
 * Theme Name: EduCare
 * Theme URI: http://demo.com/educare
 * Author: demo.com
 * Author URI: http://demo.com
 * Description: Themes Is WordPress Theme Market
 * @package eschool
 */
 global $codedokan;
 ?> 
                    
  <?php if ( is_plugin_active('woocommerce/woocommerce.php' ) ) : ?>
 
 <?php 
								$count_posts = wp_count_posts( 'product' )->publish;
								if ($count_posts == 0){
									get_template_part( 'template-parts/html/woocommerce' );
								}else{
								?>               
                    <!--=========codedokan==============
                        Course section Start
                    =============codedokan=============-->    
        <section class="course-section">
            <div class="container">
			<?php $woocommerce_title = $codedokan['woocommerce_title']; if($woocommerce_title){ ?>
                <div class="row">
                    <div class="col-lg-12 col-md-12">
                        <div class="sec-content">
                            <h1 class="sec-title">
                                <?php echo $woocommerce_title; ?>
                            </h1>
                            <div class="secIcon">
                                <img src="<?php echo get_template_directory_uri(); ?>/assets/images/heading-line.png" alt="">
                            </div>
                        </div>
                    </div>
                </div><!--End row-->
			<?php } ?>
                
                <div class="row">
                    <div class="col-lg-12">
                        <div class="coures-active owl-carousel">
                            
							<?php $cat_id = $codedokan['product_category'];
							 $how = $codedokan['how_woocommerce'];
							 if($cat_id){
					 ?>
					
					<?php 
					$term = get_term_by( 'id', $cat_id, 'product_cat' );
					$cat_id = $term->slug; 
                    $args = array(
								'post_type' => 'product',
								'posts_per_page' => $how,
								'product_cat' => $cat_id,      
								'orderby' => 'DESC',
								'offset' => 0,   
							);
                            $code_dokan = new WP_Query( $args );  							
                            while ( $code_dokan->have_posts() ) : $code_dokan->the_post(); global $product; ?>
							
							
							<div class="course-wrpp">
							<?php  $image = woocommerce_get_product_thumbnail('woocommerce_full_size'); if($image){ ?>
                                <figure class="course-image"><!--Image Crop: w:800px H:475px-->
                                     <?php echo $image; ?>
                                </figure>
							<?php } ?>
                                <h4 class="course-title">
                                    <a href="<?php the_permalink()?>"><?php the_title() ?> </a>	
                                </h4>
                                <div class="course-priceContent">
                                    <div class="course-price">
                                        <?php echo $product->get_price_html(); ?>
                                    </div>

                                    <div class="course-btn">
                                        <?php woocommerce_template_loop_add_to_cart(); ?>
                                    </div>
                                </div><!--End Price-->
                            </div><!--End wrpp-->
							
							<?php endwhile; wp_reset_query(); ?>  
							
							
							 <?php } else{ ?>
							 
							 <div class="course-wrpp">
                                <figure class="course-image"><!--Image Crop: w:800px H:475px-->
                                    <img src="<?php echo get_template_directory_uri(); ?>/assets/images/courses/course-1.jpg" alt="">
                                </figure>
                                <h4 class="course-title">
                                    <a href="product-single.html"> fundamental Photoshope learn now  </a>
                                </h4>
                                <div class="course-priceContent">
                                    <div class="course-price">
                                        $850 <span> $500 </span>
                                    </div>

                                    <div class="course-btn">
                                        <a href="product-single.html"> <i class="las la-shopping-cart"></i> Add to cart </a>
                                    </div>
                                </div><!--End Price-->
                            </div><!--End wrpp-->
							
							 <?php } ?>
							 



                        </div><!--End owl-carousel-->
                    </div><!--End col-12-->
                </div><!--Edn row-->
            </div><!--End container-->
        </section><!--End section-->
            
            
<?php } endif; ?>  
                