<div class="tt_product_module{% if config_module.row >=2 %}{{' multi-rows'}}{% endif %} {{ config_module.class }}" id="product_module{{ config_module.module_id }}">
    <div class="module-title">
		{% if config_module.sub_title_lang[code].sub_title %}
		  <p class="sub-title">{{ config_module.sub_title_lang[code].sub_title }}</p>
		{% endif %}	
	  
		{% if config_module.title_lang[code].title %}
		  <h2>{{ config_module.title_lang[code].title }}</h2>
		{% else %}
		  <h2>{{ heading_title }}</h2>
		{% endif %}
		{% if config_module.showdescription %}
		<div class="module-description">
		  {{ module_description }}
		 
		</div>
	  {% endif %}
	  
	</div>
	 
	
	{% if config_module.slider %}
		{% set class_slider = ' owl-carousel owl-theme '%}
	{% else %}
		{% set class_slider = ''%}
	{% endif %}
	{% if config_module.nrow == 0 %}
		{% set class = 'two_items col-lg-6 col-md-6 col-sm-6 col-xs-12' %}
	{% elseif config_module.nrow == 1 %}
		{% set class = 'three_items col-lg-4 col-md-4 col-sm-4 col-xs-12' %}
	{% elseif config_module.nrow == 2 %}
		{% set class = 'four_items col-lg-3 col-md-3 col-sm-3 col-xs-12' %}
	{% else %}		
		{% set class = 'six_items col-lg-2 col-md-2 col-sm-2 col-xs-12' %}
	{% endif %}
	{% if products|length > 0 %}
		{% if config_module.row %}
			{% set rows = config_module.row %}
		{% else %}
			{% set rows = 1 %}
		{% endif %}
		{% set count = 0 %}
		{% set i = 0 %}
    <div class="owl-container">
	<div class="tt-product {{ class_slider }}">	
        {% for product in products %}
			{% if not config_module.slider %}{% set rows = 1 %}{% endif %}
            <!-- Grid -->
			{% if count % rows == 0 %}
			{% set i = i + 1 %}
			<div class="row_items {% if not config_module.slider %}{{ class }}{% endif %} {% if i % 2 == 0 %}even{% else %}odd{% endif %}">
			{% endif %}
			{% set count = count + 1 %}
            {% if config_module.type == 0 %}
				<div class="product-layout grid-style ">
					<div class="product-thumb transition">
						<div class="item">
							<div class="item-inner">
								<div class="caption">
									<div class="inner">
									{% if product.manufacturer %}
									<p class="manufacture-product">
										<span>{{ text_manufacturer ~ ' ' }}</span><a href="{{ product.manufacturers }}">{{ product.manufacturer }}</a>
									</p>
									{% endif %}
									<div class="ratings">
										<div class="rating-box">
										{% for i in 0..5 %}
											{% if product.rating == i %}
											{% set class_r = "rating"~i %}
											<div class="{{ class_r }}">rating</div>
											{% endif %}
										{% endfor %}
										</div>
									</div>					
									<h4 class="product-name"><a href="{{ product.href }}">{{ product.name }}</a></h4>
									{% if config_module.description %}
										<div class="product-des">{{ product.description }}</div>
									{% endif %}
									{% if use_catalog %}
									{% if product.price %}
										<div class="price-box">
										<label>{{ price_label }}</label>
										{% if not product.special %}
											<p class="regular-price"><span class="price">{{ product.price }}</span></p>
										{% else %}
											<p class="special-price"><span class="price">{{ product.special }}</span></p>
											<p class="old-price"><span class="price">{{ product.price }}</span></p>						  
										{% endif %}
										{% if product.tax %}
											<p class="price-tax"><span class="price">{{ text_tax }} {{ product.tax }}</span></p>
										{% endif %}
										</div>
									{% endif %}
									{% endif %}
									<p class="available">{{ text_stock }}<span class="ex-text">{{ product.stock }}</span></p>
									
										
									{% if config_module.countdown %}<div class="text-hurryup"><p>{{ text_hurryup }}</p></div><div id="Countdown{{ product.product_id }}-{{ i }}" class="box-timer"></div> {% endif %}
									{% if config_module.showcart or config_module.showwishlist or  config_module.showcompare %}	
										<div class="action-links">
											{% if use_catalog %}
												{% if config_module.showcart %}
													<button class="button btn-cart" type="button"  title="{{ button_cart }}" onclick="cart.add('{{ product.product_id }}');"><span>{{ button_cart }}</span></button>
												{% endif %}
											{% endif %}	
											{% if config_module.showwishlist %}
												<button class="button btn-wishlist" type="button"  title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><span>{{ button_wishlist }}</span></button>
											{% endif %}
											
											{% if config_module.showcompare %}
												<button class="button btn-compare" type="button"  title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><span>{{ button_compare }}</span></button>
											{% endif %}	
										</div>
									{% endif %}
									</div>
								</div><!-- caption -->
								<div class="image images-container">
									<a href="{{ product.href }}" class="product-image">
										{% if config_module.rotator and product.rotator_image %}<img class="img-r" src="{{ product.rotator_image }}" alt="{{ product.name }}" />{% endif %}
										<img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive {% if config_module.rotator and product.rotator_image %}{{ 'has-rotator' }}{% endif %}" />
									</a>				  
									<div class="box-label">	
										{% if config_module.newlabel %}
											{% if product.is_new %}
											<div class="label-product label_new"><span>{{ text_label_new }}</span></div>
											{% endif %}
										{% endif %}
										{% if config_module.salelabel %}
											{% if product.special %}
											<div class="label-product label_sale"><span>{{  '-' ~ product.rate_special ~ '% ' ~ text_label_sale }}</span></div>
											{% endif %} 
										{% endif %}
										
									</div>
									{% if use_quickview %}
										{% if config_module.showquickview %}
											<button class="button btn-quickview" type="button"  title="{{ button_quickview }}" onclick="ocquickview.ajaxView('{{ product.href }}')"><span>{{ button_quickview }}</span></button>
										{% endif %}
									{% endif %}
								</div><!-- image -->
								
							</div>
						</div>
					</div><!-- product-thumb -->
						{% if product.date_end and config_module.countdown %}
						<script >
						$(document).ready(function () {
						$('#Countdown{{ product.product_id }}-{{ i }}').countdown({
						until: new Date({{ product.date_end|date("Y") }}, {{ product.date_end|date("m") }}-1, {{ product.date_end|date("d") }}, {{ product.date_end|date("H") }}, {{ product.date_end|date("i") }}, {{ product.date_end|date("s") }}),
						labels: ['{{ text_years }}', '{{ text_months }} ', '{{ text_weeks }}', '{{ text_days }}', '{{ text_hrs }}', '{{ text_mins }}', '{{ text_secs }}'],
						labels1: ['{{ text_year }}', '{{ text_month }} ', '{{ text_week }}', '{{ text_day }}', '{{ text_hr }}', '{{ text_min }}', '{{ text_sec }}'],
						});
						 //$('#Countdown{{ product.product_id }}-{{ i }}').countdown('pause');
						});
						</script>
						{% endif %}
				</div><!-- product-layout -->
            {% elseif config_module.type == 1 %}
            <!-- List -->
            <div class="product-layout list-style ">
					<div class="product-thumb transition">
						<div class="item">
							<div class="item-inner">
								<div class="image images-container">
									<a href="{{ product.href }}" class="product-image">
										{% if config_module.rotator and product.rotator_image %}<img class="img-r" src="{{ product.rotator_image }}" alt="{{ product.name }}" />{% endif %}
										<img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" />
									</a>				  
									<div class="box-label">
										{% if config_module.newlabel %}
											{% if product.is_new %}
											<div class="label-product label_new"><span>{{ text_label_new }}</span></div>
											{% endif %}
										{% endif %}
										{% if config_module.salelabel %}
											{% if product.special %}
											<div class="label-product label_sale"><span>{{  '-' ~ product.rate_special ~ '% ' ~ text_label_sale }}</span></div>
											{% endif %}
										{% endif %}
										
									</div>
									
									{% if config_module.showwishlist or config_module.showquickview or  config_module.showcompare %}	
										
											<div class="action-links">
												
												{% if use_quickview %}
													{% if config_module.showquickview %}
														<button class="button btn-quickview" type="button"  title="{{ button_quickview }}" onclick="ocquickview.ajaxView('{{ product.href }}')"><span>{{ button_quickview }}</span></button>
													{% endif %}
												{% endif %}
												{% if config_module.showwishlist %}
													<button class="button btn-wishlist" type="button"  title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><span>{{ button_wishlist }}</span></button>
												{% endif %}
												{% if config_module.showcompare %}
													<button class="button btn-compare" type="button"  title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><span>{{ button_compare }}</span></button>
												{% endif %}
												
											</div>
										
									{% endif %}
								</div><!-- image -->
								<div class="caption">
									{% if product.manufacturer %}
									<p class="manufacture-product">
										<a href="{{ product.manufacturers }}">{{ product.manufacturer }}</a>
									</p>
									{% endif %}
									
									<div class="ratings">
										<div class="rating-box">
										{% for i in 0..5 %}
											{% if product.rating == i %}
											{% set class_r = "rating"~i %}
											<div class="{{ class_r }}">rating</div>
											{% endif %}
										{% endfor %}
										</div>
									</div>					
									
									<h4 class="product-name"><a href="{{ product.href }}">{{ product.name }}</a></h4> 
									{% if config_module.description %}
									<div class="product-des">{{ product.description }}</div>
									{% endif %}
									
									{% if use_catalog %}
									{% if product.price %}
										<div class="price-box">
										<label>{{ price_label }}</label>
										{% if not product.special %}
											<p class="regular-price"><span class="price">{{ product.price }}</span></p>
										{% else %}
											<p class="special-price"><span class="price">{{ product.special }}</span></p>
											<p class="old-price"><span class="price">{{ product.price }}</span></p>						  
										{% endif %}
										{% if product.tax %}
											<p class="price-tax"><span class="price">{{ text_tax }} {{ product.tax }}</span></p>
										{% endif %}
										</div>
									{% endif %}
									{% endif %}
									{% if use_catalog %}
										{% if config_module.showcart %}
											<button class="button btn-cart" type="button"  title="{{ button_cart }}" onclick="cart.add('{{ product.product_id }}');"><span>{{ button_cart }}</span></button>
										{% endif %}
									{% endif %}
									
									
									{% if config_module.countdown %}<div class="text-hurryup"><p>{{ text_hurryup }}</p></div><div id="Countdown{{ product.product_id }}-{{ i }}" class="box-timer"></div> {% endif %}
									
								</div><!-- caption -->
							</div>
						</div>
					</div><!-- product-thumb -->
						{% if product.date_end and config_module.countdown %}
						<script >
						$(document).ready(function () {
						$('#Countdown{{ product.product_id }}-{{ i }}').countdown({
						until: new Date({{ product.date_end|date("Y") }}, {{ product.date_end|date("m") }}-1, {{ product.date_end|date("d") }}, {{ product.date_end|date("H") }}, {{ product.date_end|date("i") }}, {{ product.date_end|date("s") }}),
						labels: ['{{ text_years }}', '{{ text_months }} ', '{{ text_weeks }}', '{{ text_days }}', '{{ text_hrs }}', '{{ text_mins }}', '{{ text_secs }}'],
						labels1: ['{{ text_year }}', '{{ text_month }} ', '{{ text_week }}', '{{ text_day }}', '{{ text_hr }}', '{{ text_min }}', '{{ text_sec }}'],
						});
						//$('#Countdown{{ product.product_id }}-{{ i }}').countdown('pause');
						});
						</script>
						{% endif %}
				</div><!-- product-layout -->
            {% else %}
            <!-- other type -->
            <div class="product-layout product-customize ">
					<div class="product-thumb transition">
						<div class="item">
							<div class="item-inner">
								
									
										<div class="image images-container ">
											<a href="{{ product.href }}" class="product-image">
												{% if config_module.rotator and product.rotator_image %}<img class="img-r" src="{{ product.rotator_image }}" alt="{{ product.name }}" />{% endif %}
												<img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" />
											</a>
											<div class="box-label">	
												{% if config_module.newlabel %}
													{% if product.is_new %}
													<div class="label-product label_new"><span>{{ text_label_new }}</span></div>
													{% endif %}
												{% endif %}
												{% if config_module.salelabel %}
													{% if product.special %}
													<div class="label-product label_sale"><span>{{  '-' ~ product.rate_special ~ '% ' ~ text_label_sale }}</span></div>
													{% endif %} 
												{% endif %}
												
											</div>
											{% if use_quickview %}
												{% if config_module.showquickview %}
													<button class="button btn-quickview" type="button"  title="{{ button_quickview }}" onclick="ocquickview.ajaxView('{{ product.href }}')"><span>{{ button_quickview }}</span></button>
												{% endif %}
											{% endif %}
											
										</div><!-- image -->
									
									
										<div class="caption">
											{% if product.manufacturer %}
											<p class="manufacture-product">
												{{ text_manufacture }}
												<a href="{{ product.manufacturers }}">{{ product.manufacturer }}</a>
											</p>
											{% endif %}
											<h4 class="product-name"><a href="{{ product.href }}">{{ product.name }}</a></h4>
											
											{% if config_module.description %}
											<div class="product-des">{{ product.description }}</div>
											{% endif %}
											{% if use_catalog %}
											{% if product.price %}
												<div class="price-box">
												<label>{{ price_label }}</label>
												{% if not product.special %}
													<p class="regular-price"><span class="price">{{ product.price }}</span></p>
												{% else %}
													<p class="special-price"><span class="price">{{ product.special }}</span></p>
													<p class="old-price"><span class="price">{{ product.price }}</span></p>						  
												{% endif %}
												{% if product.tax %}
													<p class="price-tax"><span class="price">{{ text_tax }} {{ product.tax }}</span></p>
												{% endif %}
												</div>
											{% endif %}
											{% endif %}
											
											<div class="ratings">
												<div class="rating-box">
												{% for i in 0..5 %}
													{% if product.rating == i %}
													{% set class_r = "rating"~i %}
													<div class="{{ class_r }}">rating</div>
													{% endif %}
												{% endfor %}
												</div>
											</div>					
											
											{% if config_module.showcart or config_module.showwishlist or  config_module.showcompare %}	
												<div class="action-links">
													{% if use_catalog %}
														{% if config_module.showcart %}
															<button class="button btn-cart" type="button"  title="{{ button_cart }}" onclick="cart.add('{{ product.product_id }}');"><span>{{ button_cart }}</span></button>
														{% endif %}
													{% endif %}
													{% if config_module.showwishlist %}
														<button class="button btn-wishlist" type="button"  title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><span>{{ button_wishlist }}</span></button>
													{% endif %}
													{% if config_module.showcompare %}
														<button class="button btn-compare" type="button"  title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><span>{{ button_compare }}</span></button>
													{% endif %}
													
													
													
													
												</div>
											{% endif %}
											{% if config_module.countdown %}<div class="text-hurryup"><p>{{ text_hurryup }}</p></div><div id="Countdown{{ product.product_id }}-{{ i }}" class="box-timer"></div> {% endif %}
											
										</div><!-- caption -->
									
								
							</div>
						</div>
					</div><!-- product-thumb -->
						{% if product.date_end and config_module.countdown %}
						<script >
						$(document).ready(function () {
						$('#Countdown{{ product.product_id }}-{{ i }}').countdown({
						until: new Date({{ product.date_end|date("Y") }}, {{ product.date_end|date("m") }}-1, {{ product.date_end|date("d") }}, {{ product.date_end|date("H") }}, {{ product.date_end|date("i") }}, {{ product.date_end|date("s") }}),
						labels: ['{{ text_years }}', '{{ text_months }} ', '{{ text_weeks }}', '{{ text_days }}', '{{ text_hrs }}', '{{ text_mins }}', '{{ text_secs }}'],
						labels1: ['{{ text_year }}', '{{ text_month }} ', '{{ text_week }}', '{{ text_day }}', '{{ text_hr }}', '{{ text_min }}', '{{ text_sec }}'],
						});
						 //$('#Countdown{{ product.product_id }}-{{ i }}').countdown('pause');
						});
						</script>
						{% endif %}
				</div><!-- product-layout -->
            {% endif %}
				{% if (count % rows == 0) or (count == products|length ) %}
				</div>
				{% endif %}
        {% endfor %}	
    </div>
	</div>
	{% if config_module.type == 2 %}
		{% set count,rows = 0,2 %}
		<div class="list-thumb">	
			<div class="owl-container">	
				<div class="thumb owl-carousel owl-theme">
					{% set i = 0 %}
					{% for product in products %}
						{% if count % rows == 0 %}
						<div class="row_thumb">
						{% endif %}
						{% set count = count + 1 %}
							<div class="thumbinner{{ i }} {{ (i==0) ? ' active' : '' }}" onclick="timerslider({{ i }})">
								<img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" />
							</div>
						{% if (count % rows == 0) or (count == products|length) %}
						</div>
						{% endif %}
						{% set i = i + 1 %}
					{% endfor %}
				</div><!-- list-thumb -->
			</div>
		</div>
	{% endif %}
	{% else %}
		<p class="text_empty">{{ text_empty }}</p>
	{% endif %}
	<div class="clearfix"></div>
</div>
{% if config_module.slider %}
    <script >
			var product_owlCarousel = $("#product_module{{ config_module.module_id }} .tt-product");
            product_owlCarousel.owlCarousel({
                loop: {% if config_module.loop %} true {% else %} false {% endif %},
                margin: {% if config_module.margin is defined %} {{ config_module.margin }} {% else %} 20 {% endif %},
                nav: {% if config_module.navigation %} true {% else %} false {% endif %},
                dots: {% if config_module.pagination %} true {% else %} false {% endif %},
                autoplay:  {% if config_module.auto %} true {% else %} false {% endif %},
                autoplayTimeout: {% if config_module.time %} {{ config_module.time }} {% else %} 1000 {% endif %},
                autoplayHoverPause: true,
                autoplaySpeed: {% if config_module.speed %} {{ config_module.speed }} {% else %} 1000 {% endif %},
                navSpeed: {% if config_module.speed %} {{ config_module.speed }} {% else %} 1000 {% endif %},
                dotsSpeed: {% if config_module.speed %} {{ config_module.speed }} {% else %} 1000 {% endif %},
				lazyLoad: true,
                responsive:{
					0:{
						items: 1,
						nav: false
					},
					480:{
						items: {{ config_module.smobile }},
						nav: false
					},
					768:{
						items: {{ config_module.mobile }}
					},
					992:{
						items: {{ config_module.tablet }}
					},
					1200:{
						items: {{ config_module.desktop }}
					},
					1600:{
						items: {{ config_module.items }}
					}
                },
				onInitialized: function() {
					owlAction();
					var i = 0;
					$('.owl-dots > .owl-dot').each(function() {
						$(this).addClass('clk-' + i);
						i++;
					});
				},
				onTranslated: function() {
					owlAction();
					
				}
            });
			function owlAction() {
				$("#product_module{{ config_module.module_id }} .tt-product .owl-item").removeClass('first');
				$("#product_module{{ config_module.module_id }} .tt-product .owl-item").removeClass('last');
				$("#product_module{{ config_module.module_id }} .tt-product .owl-item").removeClass('before-active');
				$("#product_module{{ config_module.module_id }} .tt-product .owl-item.active:first").addClass('first');
				$("#product_module{{ config_module.module_id }} .tt-product .owl-item.active:last").addClass('last');
				$('#product_module{{ config_module.module_id }} .tt-product .owl-item.active:first').prev().addClass('before-active');
			}
			
			
			
			{% if config_module.type == 2 %}
				$('#product_module{{ config_module.module_id }} .list-thumb .thumb').owlCarousel({
					loop: false,
					margin: 0,
					nav: false,
					dots: false,
					autoplay:  false,
					autoplayTimeout: {% if config_module.time %} {{ config_module.time }} {% else %} 1000 {% endif %},
					autoplayHoverPause: true,
					autoplaySpeed: {% if config_module.speed %} {{ config_module.speed }} {% else %} 1000 {% endif %},
					navSpeed: {% if config_module.speed %} {{ config_module.speed }} {% else %} 1000 {% endif %},
					dotsSpeed: {% if config_module.speed %} {{ config_module.speed }} {% else %} 1000 {% endif %},
					lazyLoad: true,
					responsive:{
						0:{
							items: 5,
							
						},
						480:{
							items: 5,
							
						},
						768:{
							items: 5
						},
						992:{
							items: 5
						},
						1200:{
							items: 5
						},
						1600:{
							items: 5
						}
					},
					onInitialized: function() {
						
					},
					onTranslated: function() {
						
					}
				});
			
			{% endif %}
			function timerslider(x){
				$(".list-thumb .thumb .row_thumb div").removeClass('active');
				$('.thumbinner' + x).addClass('active');
				$('.clk-' + x).trigger('click');
			}
    </script>
{% endif %}