{* Список товаров *}

<div class="cleancode">
{* Описание страницы (если задана) *}
{$page->body}

{if $current_page_num==1}
{* Описание категории *}
{$category->description}
{/if}

{* Описание бренда *}
{$brand->description}

</div>

<div class="category-products">
<!--Каталог товаров-->
{if $products}    
  <div class="toolbar">
    <div class="listing_header_row1">    
      <div class="pull-left">        
        <label>Сортировать по:</label>
        <div class="select_wrapper width1">

                        <select name="select1" class="custom" tabindex="1"  onchange="setLocation(this.value)">
<option value="{url sort=position page=null}"{if $sort=='position'} selected{/if}>умолчанию</option>
<option value="{url sort=price page=null}"{if $sort=='price'} selected{/if}>цене</option>
<option value="{url sort=name page=null}"{if $sort=='name'} selected{/if}>названию</option>
                                                    </select>


        </div>                           
      </div>    
      <div class="pull-left aligncenter hidden-phone">                        
        <label> 
          <span class="hidden-tablet">Отображение:
          </span>
        </label>                                                                          
        <a class="icon-th {if $smarty.cookies.view != 'list'}active{/if}" onclick="document.cookie='view=table;path=/';document.location.reload();"></a>                                                                                                  
        <a class="icon-th-list {if $smarty.cookies.view == 'list'}active{/if}"  onclick="document.cookie='view=list;path=/';document.location.reload();"></a>                                                                               
      </div>    
      <div class="pull-right alignright">
      <div class="num">         
{include file='pagination.tpl'}
		</div>  
      </div>
    </div>
    <div class="line1">
    </div>
    <div class="listing_header_row2">    
      <div class="pull-left">
	<a href="/">Главная</a>
	{if $category}
	{foreach from=$category->path item=cat}
	<span> › </span> <a href="catalog/{$cat->url}">{$cat->name|escape}</a>
	{/foreach}  
	{if $brand}
	<span> › </span> <a href="catalog/{$cat->url}/{$brand->url}">{$brand->name|escape}</a>
	{/if}
	{elseif $brand}
	<span> › </span> <a href="brands/{$brand->url}">{$brand->name|escape}</a>
	{elseif $keyword}
	<span> › </span> Поиск
	{/if}           
      </div>    
      <div class="pull-right">        
      <div class="num">         
      
		</div>  
      </div>
    </div>
  </div>
  
{* Заголовок страницы *}
{if $keyword}
<h2>Поиск {$keyword|escape}</h2>
{elseif $page}
<h2>{$page->name|escape}</h2>
{else}
<h2>{$category->name|escape} {$brand->name|escape} {$keyword|escape}</h2>
{/if}


{if $smarty.cookies.view != 'list'}
  <div class="row big_with_description"> 
{foreach $products as $product}                
<!--PRODUCT-->        
<div class="span3 product  prod">                        
  <div class="product-image-wrapper onhover">                            
        <a href="products/{$product->url}"><img src="{$product->image->filename|resize:200:200}" class="product-retina" alt="{$product->name|escape}"/></a>                       
  </div> 
 <div class="wrapper-hover">
                                <div class="product-name"><a href="products/{$product->url}">{$product->name|escape}</a></div>
                                <div class="wrapper">
                                {if $product->variants|count > 0}
 {if $product->variant->compare_price}
 <div class="label_sale_top_right"></div>                               
<div class="product-price-regular">
                                        <div class="product-price-regular">
                                            <span class="spec"><span class="price">{$product->variant->price|convert}</span>  {$currency->sign|escape}</span>
                                            <span class="old"><span class="price">{$product->variant->compare_price|convert}</span> {$currency->sign|escape}</span>
                                        </div>
                                </div><div class="sale_discount img-rounded">-{floor(abs(100-{$product->variant->price}/($product->variant->compare_price)*100))}%</div>                                
{else}                                
                                <div class="product-price"><span class="price">{$product->variant->price|convert}</span> {$currency->sign|escape}</div>
{/if}                                
                                <div class="product-tocart"><a href="{if $product->variants|count == 1}cart?variant={$product->variant->id}{else}products/{$product->url}{/if}"><i class="icon-basket"></i></a></div>
      		{else}
			Нет в наличии
		{/if} 
                                </div>
                            </div>
</div>        
<!--PRODUCT HOVER-->
<div class="preview  hidden-tablet hidden-phone prod">            
  <div class="wrapper">
    <div class="col-1">
 		{foreach $product->images as $i=>$image}
			<a class="image" href="products/{$product->url}" data-rel="{$image->filename|resize:200:200}">
			<img class="thumb" src="{$image->filename|resize:95:95}" alt="{$product->name|escape}" /></a>
		{/foreach}                                          
    </div> 
    <div class="col-2 with_media">                          
      <div class="big_image product-image-wrapper">
       <a href="products/{$product->url}"><img data-rel="{$product->image->filename|resize:200:200}" src="{$product->image->filename|resize:200:200}" alt="{$product->name|escape}"/></a> 

      </div>                          
                                     
                                      
 <div class="wrapper-hover">
                                <div class="product-name"><a href="products/{$product->url}">{$product->name|escape}</a></div>
                                <div class="wrapper">
                                {if $product->variants|count > 0}
 {if $product->variant->compare_price}
 <div class="label_sale_top_right"></div>                               
<div class="product-price-regular">
                                        <div class="product-price-regular">
                                            <span class="spec"><span class="price">{$product->variant->price|convert}</span>  {$currency->sign|escape}</span>
                                            <span class="old"><span class="price">{$product->variant->compare_price|convert}</span> {$currency->sign|escape}</span>
                                        </div>
                                </div><div class="sale_discount img-rounded">-{floor(abs(100-{$product->variant->price}/($product->variant->compare_price)*100))}%</div>                                
{else}                                
                                <div class="product-price"><span class="price">{$product->variant->price|convert}</span> {$currency->sign|escape}</div>
{/if}                                
                                <div class="product-tocart"><a href="{if $product->variants|count == 1}cart?variant={$product->variant->id}{else}products/{$product->url}{/if}"><i class="icon-basket"></i></a></div>
      		{else}
			Нет в наличии
		{/if} 
                                </div>
                            </div>                          
    </div>                       
  </div>              
</div>
<!--PRODUCT HOVER EOF-->        
<!--PRODUCT EOF-->
 {/foreach}                               
               
  </div>
{else} 
 {foreach $products as $product} 
<div class="row product-listing prod">            
  <div class="span3  product">                        
    <div class="product-image-wrapper nohover">                            
 {if $product->variant->compare_price}
 <div class="label_sale_top_right"></div> 
 <div class="sale_discount img-rounded">-{floor(abs(100-{$product->variant->price}/($product->variant->compare_price)*100))}%</div>
 {/if}                                                                             
  <a href="products/{$product->url}"><img src="{$product->image->filename|resize:200:200}" class="product-retina" alt="{$product->name|escape}"/></a>                       
    </div>
  </div>            
  <div class="span6 product-detailes">                
    <div class="product-name bottom-line">
      <a href="products/{$product->url}">{$product->name|escape}</a>
    </div>                
    <div class="bottom-line">
                        
                                {if $product->variants|count > 0}
 {if $product->variant->compare_price}
       <div class="price-box">                         
        <span class="special-price"> 
          <span class="price">
            <span class="price">{$product->variant->price|convert}</span> {$currency->sign|escape}

          </span> 
        </span>
                                         <div class="product-price-regular">
                                           
                                            <span class="old"><span class="price">{$product->variant->compare_price|convert}</span> {$currency->sign|escape}</span>
                                        </div>                           
      </div>                             
{else}
      <div class="price-box">                         
        <span class="special-price"> 
          <span class="price">
            <span class="price">{$product->variant->price|convert}</span> {$currency->sign|escape}

          </span> 
        </span>                    
      </div>                                
                               
{/if}                                
                             
      		{else}
			Нет в наличии
		{/if} 
                      
    </div>                
    <div class="bottom-line">
    {$product->annotation}
    </div>                
    <div class="product-buttons">
      {if $product->variants|count > 0}                  
      <a href="{if $product->variants|count == 1}cart?variant={$product->variant->id}{else}products/{$product->url}{/if}" class="button btn-cart">
        <i class="icon-basket"></i>В корзину</a>                    
       {/if}         
    </div>            
  </div>        
</div>
{/foreach}  
{/if} 
           
  <div class="toolbar">
    <div class="listing_header_row1">    
      <div class="pull-left">        
        <label>Сортировать по:</label>
        <div class="select_wrapper width1">

                        <select name="select1" class="custom" tabindex="1"  onchange="setLocation(this.value)">
<option value="{url sort=position page=null}"{if $sort=='position'} selected{/if}>умолчанию</option>
<option value="{url sort=price page=null}"{if $sort=='price'} selected{/if}>цене</option>
<option value="{url sort=name page=null}"{if $sort=='name'} selected{/if}>названию</option>
                                                    </select>


        </div>                           
      </div>    
      <div class="pull-left aligncenter hidden-phone">                        
        <label> 
          <span class="hidden-tablet">Отображение:
          </span>
        </label>                                                                          
        <a class="icon-th {if $smarty.cookies.view != 'list'}active{/if}" onclick="document.cookie='view=table;path=/';document.location.reload();"></a>                                                                                                  
        <a class="icon-th-list {if $smarty.cookies.view == 'list'}active{/if}"  onclick="document.cookie='view=list;path=/';document.location.reload();"></a>                                                                               
      </div>    
      <div class="pull-right alignright">
      <div class="num">         
{include file='pagination.tpl'}
		</div>  
      </div>
    </div>
    <div class="line1">
    </div>
    <div class="listing_header_row2">    
      <div class="pull-left">
	<a href="/">Главная</a>
	{if $category}
	{foreach from=$category->path item=cat}
	<span> › </span> <a href="catalog/{$cat->url}">{$cat->name|escape}</a>
	{/foreach}  
	{if $brand}
	<span> › </span> <a href="catalog/{$cat->url}/{$brand->url}">{$brand->name|escape}</a>
	{/if}
	{elseif $brand}
	<span> › </span> <a href="brands/{$brand->url}">{$brand->name|escape}</a>
	{elseif $keyword}
	<span> › </span> Поиск
	{/if}           
      </div>    
      <div class="pull-right">        
      <div class="num">         
      
		</div>  
      </div>
    </div>
  </div>
 {else}
 
{* Заголовок страницы *}
{if $keyword}
<h2>Поиск {$keyword|escape}</h2>
{elseif $page}
<h2>{$page->name|escape}</h2>
{else}
<h2>{$category->name|escape} {$brand->name|escape} {$keyword|escape}</h2>
{/if} 
 
Товары не найдены
{/if}	
<!--Каталог товаров (The End)--> 
  
</div> 