<?php //Template Name:Product Page
get_header();
$wl_theme_options = enigma_parallax_get_options();?> 
<!-- Carousel-->
  <?php $wl_theme_options = enigma_parallax_get_options(); 
   if($wl_theme_options['slider_image_speed']!='')
	{
		
	echo '<script type="text/javascript">
		jQuery(document ).ready(function( $ ) {
		jQuery("#myCarousel" ).carousel({
			interval:'.esc_attr($wl_theme_options['slider_image_speed']).'

		    });
	   });
	</script>';
	 
	} 

   ?>
<div  id="slider"></div>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
	<!-- Indicators -->
	<ol class="carousel-indicators">
		<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
		<li data-target="#myCarousel" data-slide-to="1"></li>        
		<li data-target="#myCarousel" data-slide-to="2"></li>        
	</ol>
	<div class="carousel-inner">
	
		<div class="item active">
			<?php if($wl_theme_options['slide_image_1']!='') {  ?>
			<img src="<?php echo esc_url($wl_theme_options['slide_image_1']); ?>" class="img-responsive" alt="<?php  esc_attr($wl_theme_options['slide_title_1']); ?>">
			<?php }  ?>		  
			<div class="container">
				<div class="carousel-caption">
					<?php if($wl_theme_options['slide_title_1']!='') {  ?>
					<div class="carousel-text">
						<h1 class="animated bounceInRight"><?php esc_attr($wl_theme_options['slide_title_1']); ?></h1>			
						<?php if($wl_theme_options['slide_desc_1']!='') {  ?>
						<ul class="list-unstyled carousel-list">
							<li class="animated bounceInLeft"><?php esc_attr($wl_theme_options['slide_desc_1']); ?></li>
						</ul>
						<?php }
						if($wl_theme_options['slide_btn_text_1']!='') { ?>
							<a class="enigma_blog_read_btn animated bounceInUp" href="<?php if($wl_theme_options['slide_btn_link_1']!='') { esc_url($wl_theme_options['slide_btn_link_1']); } ?>" role="button"><?php  esc_attr($wl_theme_options['slide_btn_text_1']); ?></a>
						<?php } ?>
					</div>
					<?php } ?>
				</div>
			</div>
		</div>		
		<div class="item">		
			<?php if($wl_theme_options['slide_image_2']!='') {  ?>
			<img src="<?php echo esc_url($wl_theme_options['slide_image_2']); ?>" class="img-responsive" alt="<?php echo esc_attr($wl_theme_options['slide_title_2']); ?>">
			<?php } ?>
			<div class="container">
				<div class="carousel-caption">			
					<?php if($wl_theme_options['slide_title_2']!='') {  ?>
					<div class="carousel-text">
						<h1 class="animated bounceInRight"><?php esc_attr($wl_theme_options['slide_title_2']); ?></h1>
						<?php if($wl_theme_options['slide_desc_2']!='') {  ?>
						<ul class="list-unstyled carousel-list">
							<li class="animated bounceInLeft"><?php esc_attr($wl_theme_options['slide_desc_2']); ?></li>
						</ul>
						<?php } if($wl_theme_options['slide_btn_text_2']!='') { ?>
						<a class="enigma_blog_read_btn animated bounceInUp" href="<?php if($wl_theme_options['slide_btn_link_2']!='') { esc_url($wl_theme_options['slide_btn_link_2']); } ?>" role="button"><?php esc_attr($wl_theme_options['slide_btn_text_2']); ?></a>
						<?php } ?>
					</div>
					<?php } ?>
				</div>
			</div>
		</div>
		<div class="item">		
			<?php if($wl_theme_options['slide_image_3']!='') {  ?>
			<img src="<?php echo esc_url($wl_theme_options['slide_image_3']); ?>" class="img-responsive" alt="<?php echo esc_attr($wl_theme_options['slide_title_3']); ?>">
			<?php } ?>
			 <div class="container">
				<div class="carousel-caption">
					<?php if($wl_theme_options['slide_title_3']!='') {  ?>
					<div class="carousel-text">
						<h1 class="animated bounceInRight"><?php esc_attr($wl_theme_options['slide_title_3']); ?></h1>
						<?php if($wl_theme_options['slide_desc_3']!='') {  ?>
							<ul class="list-unstyled carousel-list">
								<li class="animated bounceInLeft"><?php esc_attr($wl_theme_options['slide_desc_3']); ?></li>
							</ul>
						 <?php }
						if($wl_theme_options['slide_btn_text_3']!='') { ?>
							<a class="enigma_blog_read_btn animated bounceInUp" href="<?php if($wl_theme_options['slide_btn_link_3']!='') { esc_url($wl_theme_options['slide_btn_link_3']); } ?>" role="button"><?php esc_attr($wl_theme_options['slide_btn_text_3']); ?></a>
						  <?php } ?>
					</div>
					<?php } ?>
				</div>
			</div>
		</div>		
	</div>
	<a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
	<a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
	<div class="enigma_slider_shadow"></div>
</div><!-- /.carousel -->
<div class="container product"> 
<?php if($wl_theme_options['product_title']!='') {  ?>
<h1> <?php echo esc_attr($wl_theme_options['product_title']); ?> </h1><?php } ?> 
<?php get_template_part( ABSPATH . 'wp-admin/includes/plugin.php' );
                // check for plugin using plugin name
                if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
                 $args = array( 'post_type' => 'product','orderby' => 'rand' );
                   $loop = new WP_Query( $args ); ?>
                   <?php if( $loop->have_posts() ){ ?>
               <?php  while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
                    
                        <div class="col-md-3 about-men-top">
						<div class="col-md-12 pro">
                            <div class="img-thumbnail gallery">
                                <?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog'); else echo '<img
                                src="'.esc_url(woocommerce_placeholder_img_src()).'" alt="Placeholder" class="img-responsive" />'; ?>
                            </div>
                            <div class="col-md-12 col-sm-12 about-men-name">
                                <h2><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h2>
                                <span class="price"><?php echo esc_html($product->get_price_html()); ?></span> <br>
								<div class="col-md-12 pro_btn">
								<?php woocommerce_template_loop_add_to_cart($loop->post,$product); ?>
								</div>
                            </div>   
                            </div>   
                       </div>
                     <?php endwhile; wp_reset_postdata();?>
                    <?php } else {
                        echo "<p class='sqltitle' style='color:#fff;'>No Featured Products Added Yet..!!</p>";
                    } } ?>
					</div>
 <?php 
get_footer();