<div class="box all-products mt-50">
	<div class="box-heading container">
		<div class="box-content bestseller">
			<div class="page-title toggled"><h3>{{ heading_title }}</h3></div>
			<div class="row">
				<div class="block_box">
					{% set productForSlider = 1 %}
					{% set productCount = products|length %}
					<div id="bestseller-carousel" class="box-product {% if productCount > productForSlider %} product-carousel  {% endif %} clearfix" data-items="4">
						{% for product in products %}
						{% if productCount > productForSlider %}
							{% set class = ' col-xs-12' %}
						{% else %}
							{% set class = ' col-lg-3 col-md-3 col-sm-4 col-xs-4' %}
						{% endif %}
						<div class="product-layout {{class}}">
							<div class="product-thumb transition clearfix">
								<div class="image">
									{% if  product.special %}
										<div class="sale-text"><span class="section-sale">-{{ product.percent }}%</span></div>
									{% endif %}
										<a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" /></a>
										<button type="button" data-toggle="tooltip" class="quickview-button" title="{{ button_quickview }}" onclick="quickView.ajaxView('?route=product/quickview&product_id={{ product.product_id }}');"><i class="icon-eye"></i></button>
									<div class="button-group">
										<button type="button" class="addcart" title="{{ button_cart }}" onclick="cart.add('{{ product.product_id }}')"><i class="fa fa-shopping-basket"></i><span class="button-text">{{ button_cart }}</span></button>
										<button type="button" class="wishlist" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><i class="icon-heart"></i><span class="button-text"><span class="sign">+</span>Add to wishlist</span></button>											
										<button type="button" class="compare" title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><i class="icon-change"></i><span class="button-text"><span class="sign">+</span>Add to compare</span></button>
									</div>
									{% if product.rating %}
										<div class="rating">
											{% for i in 1..5 %}
												{% if product.rating < i %} 
													<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span> {% else %} <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
												{% endif %}
											{% endfor %}
										</div>
									{% else %}
										<div class="rating">
											{% for i in 1..5 %}
												<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
											{% endfor %}
										</div>
									{% endif %}	
								</div>
								<div class="thumb-description">
									<div class="caption">
										<h4 class="product-title"><a href="{{ product.href }}">{{ product.name }}</a></h4>									
										{% if product.price %}
											<p class="price">
												{% if not product.special %}
													{{ product.price }}
												{% else %}
													<span class="price-new">{{ product.special }}</span><span class="price-old">{{ product.price }}</span>
												{% endif %}
												{% endif %} 
												{% if product.tax %}
												<span class="price-tax">{{ text_tax }} {{ product.tax }}</span>
											</p>
										{% endif %}										
										{% if product.rating %}
											<div class="rating">
												{% for i in 1..5 %}
													{% if product.rating < i %} 
														<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span> {% else %} <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
													{% endif %}
												{% endfor %}
											</div>
										{% else %}
											<div class="rating">
												{% for i in 1..5 %}
													<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
												{% endfor %}
											</div>
										{% endif %}	
									</div>												
								</div>
							</div>
						</div>
						{% endfor %}
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
