{* Страница товара *}

<!--BREADCRUMBS-->
<div class="content_top">    
  <div class="wrapper_w">        
    <div class="pull-left">            
      <div class="breadcrumbs">                                     
        <a href="./" title="На Главную">Главная</a>
	{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}
	<span> › </span>  {$product->name|escape}                                                                                  
      </div>        
    </div>             
  </div>
</div>
<!--BREADCRUMBS EOF-->
<!--PRODUCT BOX-->
   
  <div class="product-box">        
        
    <div class="row">        
      <div class="span6">            
        <div class="product-img-box">                
          <div class="row">                                        
            <div class="span1">                        
              <div class="more-views">                            
                <ul>
                {foreach $product->images as $i=>$image}                                                                
                  <li> 
                  <a class="cloud-zoom-gallery" href="{$image->filename|resize:800:600}"  data-rel="useZoom: 'zoom1', smallImage: '{$image->filename|resize:450:450}'"> 
                    <img class="product-retina"  data-image2x="{$image->filename|resize:124:124}" src="{$image->filename|resize:62:62}" alt="{$product->name|escape}"   /> </a> 
                  </li>
                  {/foreach}
                                                           
                </ul>                        
              </div>                    
            </div>                                         
            <div class="span5">                        
              <div class="product-image">                            
                <a  title="" class="cloud-zoom" href="{$product->image->filename|resize:800:600}" id='zoom1' data-rel="position: 'right', adjustX: 10, adjustY: 0">                                
                  <img class="product-retina" data-image2x="{$product->image->filename|resize:800:600}" src="{$product->image->filename|resize:450:450}" alt="{$product->name|escape}"  />                            </a>                        
              </div>                    
            </div>                
          </div>            
        </div>        
      </div>        
      <div class="span6">            
        <div class="product-shop">                 
          <div class="product_custom">    <h2>Информация</h2>                                               
            <p>Вы можете добавить свою информацию здесь,<br>  
			о акциях  или какую-либо дополнительную информацию
             </p>                    
            <div class="promo_box">                        
              <div class="middle_icon_color pull-left">
                <i class="icon-tag-1"></i>
              </div>                        
              <span> <strong>Специальное предложение: 1+1=3</strong> Получи подарок!
              </span> 
            </div>                    
            <div class="promo_box">                        
              <div class="middle_icon_color pull-left">
                <i class="icon-credit-card"></i>
              </div>                        
              <span><strong>Бонусные карты </strong>Номиналом $10, $50, $100
              </span>
            </div>                    
            <div class="promo_box">                        
              <div class="middle_icon_color pull-left">
                <i class="icon-users"></i>
              </div>                        
              <span>
                <a href="#"><strong>Регистрация в нашем клубе</strong></a>
              </span>
            </div>                    
            <div class="promo_box">                        
              <div class="middle_icon_color pull-left">
                <i class="icon-truck"></i>
              </div>                        
              <span> <strong>
                  <a href="#">Бесплатная доставка</a></strong>
              </span> 
            </div>                               
          </div>                
          <div class="product_info_left">                    
            <div class="product-name">
            <h1 data-product="{$product->id}">{$product->name|escape}</h1>                   
            </div>                    
            <div class="product_type_data_price">    
              <p class="availability in-stock">
              Наличие на складе: 
              <span>
              {if $product->variants|count > 0}
              		В наличии
              		{else}
						Нет в наличии
					{/if}
              </span>
              </p>
            </div>                                            
            <div class="short-description">
            {$product->annotation}
            </div> 
 		{if $product->variants|count > 0}
		<!-- Выбор варианта товара -->
		<form class="variants" action="/cart">
		                                                                          
 {if $product->variant->compare_price}            
			<div class="price-box">
                                
                    <p class="old-price">
                <span class="price-label">Regular Price:</span>
                <span class="price" id="old-price"><span>{$product->variant->compare_price|convert}</span> {$currency->sign|escape}</span>
            </p>

                        <p class="special-price">
                <span class="price-label">Special Price:</span>
                <span class="price" id="product-price"><span>{$product->variant->price|convert}</span> {$currency->sign|escape}</span>
            </p>
                    
    
        </div>            
 {else} 
            <div class="price-box">                                                            
              <span class="regular-price">                                            
                <span class="price" id="product-price"><span>{$product->variant->price|convert}</span> {$currency->sign|escape}</span>                                    
              </span>                                 
            </div> 
{/if}

			<!-- Выбор варианта товара -->
			{* Не показывать выбор варианта, если он один и без названия *}
			<select name="variant" {if $product->variants|count==1  && !$product->variant->name}style='display:none;'{/if}>
				{foreach $product->variants as $v}
				<option value="{$v->id}" {if $v->compare_price > 0}compare_price="{$v->compare_price|convert}"{/if} price="{$v->price|convert}">
				{$v->name}
				</option>
				{/foreach}
			</select>
			<!-- Выбор варианта товара (The End) -->
 
                                                                                                                                                                                       
            <div class="add-to-cart">                        
              <div class="qty">                
                <label for="qty">К-во:
                </label>                
                <input id="qty" class="input-text qty" type="text" title="Количество товара" value="1" maxlength="12" name="amount" />            
              </div>                        
              <button class="button btn-cart" title="В корзину" type="submit">
                <i class="icon-basket"></i>В корзину
              </button>    
            </div>
            </form>                                                                                                                                                                                       
 {/if} 
 <script>
{literal}

jQuery(function() {

	// Выбор вариантов
	jQuery('select[name=variant]').change(function() {
		price = jQuery(this).find('option:selected').attr('price');
		compare_price = '';
		if(typeof jQuery(this).find('option:selected').attr('compare_price') == 'string')
			compare_price = jQuery(this).find('option:selected').attr('compare_price');
		jQuery(this).find('option:selected').attr('compare_price');
		jQuery(this).closest('form').find('span#product-price span').html(price);
		jQuery(this).closest('form').find('span#old-price span').html(compare_price);
		return false;		
	});
		
});
</script>
{/literal} 
                   
            <div class="socialsplugins_wrapper">                        
<script src="http://odnaknopka.ru/ok3.js" type="text/javascript"></script>                    
              <div class="clear">
              </div>                    
            </div>                                     
          </div>            
        </div>        
      </div>    
    </div>    
  </div>
  <!--PRODUCT BOX EOF-->

<div class="row">    
  <div class="span12">        
    <ul class="nav-tabs" id="myTab">            
      <li class="active">
        <a href="#tab1">Описание</a>
      </li>            
      <li>
      <a href="#tab2">Отзывы ({$comments|count})</a>
      </li>
      {if $product->features}            
      <li>
      <a href="#tab3">Характеристики</a>
      </li>                        
       {/if}            
    </ul>        
    <div class="tab-content">            
      <div class="tab-pane active" id="tab1">                                
        <div class="box-collateral box-description">    
          <div class="std">
{$product->body}
          </div>                
        </div>                            
      </div>            
      <div class="tab-pane" id="tab2">                 
        <div class="box-collateral box-reviews" id="customer-reviews">        
<!-- Комментарии -->
<div id="comments">	
	{if $comments}
	<!-- Список с комментариями -->
	<ul class="comment_list">
		{foreach $comments as $comment}
		<a name="comment_{$comment->id}"></a>
		<li>
			<!-- Имя и дата комментария-->
			<div class="comment_header">	
				{$comment->name|escape} <i>{$comment->date|date}, {$comment->date|time}</i>
				{if !$comment->approved}ожидает модерации</b>{/if}
			</div>
			<!-- Имя и дата комментария (The End)-->
			
			<!-- Комментарий -->
			{$comment->text|escape|nl2br}
			<!-- Комментарий (The End)-->
		</li>
		{/foreach}
	</ul>
	<!-- Список с комментариями (The End)-->
	{else}
	<p>
		Пока нет комментариев
	</p>
	{/if}
	
	<!--Форма отправления комментария-->	
	<form class="comment_form" method="post">
		<h2>Написать комментарий</h2>
		{if $error}
		<div class="message_error">
			{if $error=='captcha'}
			Неверно введена капча
			{elseif $error=='empty_name'}
			Введите имя
			{elseif $error=='empty_comment'}
			Введите комментарий
			{/if}
		</div>
		{/if}
		<textarea class="comment_textarea" id="comment_text" name="text" data-format=".+" data-notice="Введите комментарий">{$comment_text}</textarea><br />
		<div>
		<label for="comment_name">Имя</label>
		<input class="input_name" type="text" id="comment_name" name="name" value="{$comment_name}" data-format=".+" data-notice="Введите имя"/><br />

		<input class="button" type="submit" name="comment" value="Отправить" />
		
		<label for="comment_captcha">Число</label>
		<div class="captcha"><img src="captcha/image.php?{math equation='rand(10,10000)'}" alt='captcha'/></div> 
		<input class="input_captcha" id="comment_captcha" type="text" name="captcha_code" value="" data-format="\d\d\d\d" data-notice="Введите капчу"/>
		
		</div>
	</form>
	<!--Форма отправления комментария (The End)-->
	
</div>
<!-- Комментарии (The End) -->
        </div>            
      </div>
      {if $product->features}            
      <div class="tab-pane" id="tab3">                    
        <div class="box-collateral box-tags">
	<!-- Характеристики товара -->
	<ul class="features">
	{foreach $product->features as $f}
	<li>
		<label>{$f->name}</label>
		<span>{$f->value}</span>
	</li>
	{/foreach}
	</ul>
	<!-- Характеристики товара (The End)-->
        </div>            
      </div>                        
       {/if}             
    </div>    
  </div>
</div>
{* Связанные товары *}
{if $related_products}
<div class="upsell">
<h2>Так же советуем посмотреть</h2>
  <div class="carousel es-carousel-wrapper style0 upsell">
    <div class="es-carousel">
      <div class="row">    
        <div class="product_outer">
        {foreach $related_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">            
  <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">
       <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->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="cart?variant={$product->variant->id}"><i class="icon-basket"></i></a></div>
                                </div>
                            </div>                          
    </div>                       
  </div>              
</div>
<!--PRODUCT HOVER EOF-->        
<!--PRODUCT EOF-->
 {/foreach}          
        </div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
    jQuery('.carousel.style0').elastislide({
        easing: 'easeInOutQuad',
        speed: 1200,
    });
    </script>
{/if}
{literal}
<script>
jQuery(function() {
	// Раскраска строк характеристик
	jQuery(".features li:even").addClass('even');


});
</script>
{/literal}
