	<?php
/**
 * @package Luzuk Theme
 */
if(get_theme_mod('recentproductout_section_disable') != 'on' ){
	?>

	 <?php 
            if( get_theme_mod('recentproductout_toppadding',true) ) {
                $recentproductout_toppadding = 'padding-top:'.esc_attr(get_theme_mod('recentproductout_toppadding')).';';
            }
            if( get_theme_mod('recentproductout_bottompadding',true) ) {
                $recentproductout_bottompadding = 'padding-bottom:'.esc_attr(get_theme_mod('recentproductout_bottompadding')).';';
            }
            if( get_theme_mod('recentproductout_leftpadding',true) ) {
                $recentproductout_leftpadding = 'padding-left:'.esc_attr(get_theme_mod('recentproductout_leftpadding')).';';
            }
            if( get_theme_mod('recentproductout_rightpadding',true) ) {
                $recentproductout_rightpadding = 'padding-right:'.esc_attr(get_theme_mod('recentproductout_rightpadding')).';';
            }
    ?>
	<section id="recent-post-section" class="ht-section" style="<?php echo esc_attr($recentproductout_toppadding); ?>" "<?php echo esc_attr($recentproductout_bottompadding); ?>" "<?php echo esc_attr($recentproductout_leftpadding); ?>" "<?php echo esc_attr($recentproductout_rightpadding); ?>">

		<div class="container">
			<div class="recent-posts-box">
				<div class="wow fadeInUp" data-wow-duration="1s">
					<?php
					$showStatic = true;
					for( $i = 1; $i < 4; $i++ ){
						$lz_fitness_recentproduct_page_id = get_theme_mod('lz_fitness_recentproduct_page'.$i); 
						if(!empty($lz_fitness_recentproduct_page_id)){
							$showStatic = false;
							break;
						}
					}
					$lz_fitness_recent_product_title = get_theme_mod('lz_fitness_recent_product_title', 'Recent Products');	
					?>
					<div class="row">
						<div class="ht-section-title-tagline">
							<h2 class="ht-section-title lz-recentproduct-heading">
								<?php
								if(!empty($lz_fitness_recent_product_title))	{
									echo ($lz_fitness_recent_product_title);
								} ?>
							</h2>
						</div>
						<div class="clearfix"></div>
					</div>
					<div class="row">
					    		<?php
					    		if(function_exists('woocommerce_template_loop_add_to_cart') && function_exists('WC')){
					    			$args = array( 'post_type' => 'product', 'stock' => 1, 'posts_per_page' => 4, 'orderby' =>'date','order' => 'DESC' );
					    			$meta_query   = WC()->query->get_meta_query();
					    			$tax_query   = WC()->query->get_tax_query();
					    			
					    			$args = array(
					    				'post_type'   =>  'product',
					    				'stock'       =>  1,
					    				'posts_per_page' => 12, 
					    				'orderby'     =>  'date',
					    				'order'       =>  'DESC',
					    				'meta_query'  =>  $meta_query,
					    				'tax_query'   => $tax_query,
					    			);
					    			$loop = new WP_Query( $args );
					    			if($loop->post_count > 0){
					    				while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
					    					<div class="col-md-3 col-sm-6  slide-item recent-product rpost wow zoomIn"> 
					    						<div id="recent-porduct">
					    							<div class="col-md-5 padding0">
								    						<div class="pro-img text-center">
								    							<a id="id-<?php the_id(); ?>" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
								    								<?php if (has_post_thumbnail( $loop->post->ID )) 
								    								echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog');
								    								else
								    									echo '<img src="'.get_template_directory_uri().'/images/default.png" alt="Placeholder" width="100%" height="200px" />'; ?>	
								    							</a>
								    						</div>
							    						</div>
					    							
					    								<div class="col-md-7 padding0">
								    						<div class="total-product-title-wrap">
								    							<a id="id-<?php the_id(); ?>" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">	
																	<h6><?php the_title();?></h6>
																</a>
																<span class="price"><?php echo $product->get_price_html(); ?></span>
																<div class="clearfix"></div>
																<!-- <div class="add-to-cart">
																	<?php
																	// woocommerce_template_loop_add_to_cart( $loop->single-product, $product );
																	//woocommerce_template_loop_add_to_cart();
																	?>
																</div> -->
															</div>
														</div>
														<div class="clearfix"></div>
					    							</div>
					    						</div><!-- /span3 -->
					    						<?php
					    					endwhile; 
					    				}else{ ?>
					    					<div class="alert alert-warning text-center">
					    						<strong>Sorry, no recent products to show.</strong>
					    					</div>
					    					<?php
					    				}
					    				?>
					    				<!-- </div>-->
					    				<!-- </div>-->
					    				<?php
					    				wp_reset_query(); 
					    			}else{ ?>
					    				<div class="alert alert-warning text-center">
					    					Kindly Install or Activate the WooCommerce plugin.
					    				</div>
					    				<?php
					    			}?>
					    	</div>
					    <div class="clearfix"></div>
					</div>
				</div>

				<div class="clearfix"></div>

			</div>
		</section>
		<script>
	jQuery.noConflict();
	$(function(){
		function rpostHeight(){
			var ht = 0;
			$('#recent-post-section #recent-porduct').each(function(i){
				var tHt = $(this).height();
				if(ht<tHt){
					ht=tHt;
				}
			});
			$('#recent-post-section #recent-porduct').height(ht+'px');
		}
		rpostHeight();
	});
	$( window ).resize(function(){
		rpostHeight();
	});
</script>

<?php }
?>