{{ header }}
  <script src="catalog/view/theme/madeshop/script/slick.min.js" type="text/javascript"></script>
  <script src="catalog/view/theme/madeshop/script/jquery.zoom.min.js" type="text/javascript"></script>
  
  <div class="container">
  <ul class="breadcrumb">
      {% set i = 0 %}
	  {% for breadcrumb in breadcrumbs %}
	  {% set i = i + 1 %}
	  <li itemscope itemprop="itemListElement" itemtype="http://schema.org/ListItem">
	  <a href="{{ breadcrumb.href }}" itemprop="item">
	  <span itemprop="name">{{ breadcrumb.text }}</span>
      <meta itemprop="position" content="{{ i }}">
	  </a>
	  </li>
	  {% endfor %}
      <li itemscope itemprop="itemListElement" itemtype="http://schema.org/ListItem">
	  <span itemprop="name">{{ breadlast.text }}</span>
	  <meta itemprop="position" content="{{ i + 1 }}">
	  </li>
  </ul>
  {{ content_top }}
  </div>
  <div itemscope itemtype="http://schema.org/Product">
  <div class="container">
  <div class="row">{{ column_left }}
    {% if column_left and column_right %}
    {% set class = 'col-sm-6' %}
    {% elseif column_left or column_right %}
    {% set class = 'col-sm-9' %}
    {% else %}
    {% set class = 'col-sm-12' %}
    {% endif %}
    <div id="content" class="{{ class }} product">
      <div class="row">
        {% if column_left or column_right %}
        {% set class = 'col-sm-6' %}
        {% else %}
        {% set class = 'col-sm-8' %}
        {% endif %}
        <div class="col-sm-{{ madeshop_width_left }}">
		{% if madeshop_thumb == 0 %}
		<div class="over">
		  <div class="hn">
		    {{ hit }}
		    {{ new }}
		  </div>
		  <ul id="one-image" class="left-thumb zoom{{ zoom }}" style="width: calc(100% - {{ madeshop_image_additional_width }}px)">
			<li class="zoom"><img src="{{ fix2 }}" title="{{ heading_title }}" alt="{{ heading_title }}" class="img0 one-img" itemprop="image" data-src="{{ popup }}" /></li>
			{% for image in images %}
			<li class="zoom"><img src="{{ image.norm }}" title="{{ heading_title }}" alt="{{ heading_title }}" class="one-img" data-src="{{ image.popup }}"/></li>
			{% endfor %}
		  </ul>
		</div>
		<script type="text/javascript"><!--
			$('#one-image').slick({
				slidesToShow: 1,
				slidesToScroll: 1,
				cssEase: 'linear',
				arrows: false,
                responsive: [
        {
        breakpoint: 767,
			settings: {
			dots: true,
			customPaging : function(slider, i) {return '';}
			}
        }
        ] 
			}); 
             
		//--></script> 
		 {% elseif madeshop_thumb == 1 %}
		<div class="over">
		  <div class="hn right">
		    {{ hit }}
		    {{ new }}
		  </div>
		  <ul id="image-additional" style="width: {{ madeshop_image_additional_width }}px">
			<li class="image-additional"><img src="{{ fix }}" title="{{ heading_title }}" alt="{{ heading_title }}" class="fix-img" /></li>
			{% for image in images %}
			<li class="image-additional"><img src="{{ image.thumb }}" data-zoom-image="{{ image.popup }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></li>
			{% endfor %}
		  </ul>   
		  <ul id="one-image" class="left-thumb zoom{{ zoom }}" style="width: calc(100% - {{ madeshop_image_additional_width }}px)">
			<li class="zoom"><img src="{{ fix2 }}" title="{{ heading_title }}" alt="{{ heading_title }}" class="img0 one-img" itemprop="image" data-src="{{ popup }}" /></li>
			{% for image in images %}
			<li class="zoom"><img src="{{ image.norm }}" title="{{ heading_title }}" alt="{{ heading_title }}" class="one-img" data-src="{{ image.popup }}"/></li>
			{% endfor %}
		  </ul>
		</div>
        <script type="text/javascript"><!--   
		
		$('#one-image').slick({
 	    slidesToShow: 1,
 	    slidesToScroll: 1,
        cssEase: 'linear',
        asNavFor: '#image-additional',
		arrows: false,
		responsive: [
        {
        breakpoint: 767,
			settings: {
			dots: true,
			customPaging : function(slider, i) {return '';}
			}
        }
        ]       
        });

    	$('#image-additional').slick({
    		slidesToShow: {{ madeshop_num_thumb }},
    		slidesToScroll: 1,
    		asNavFor: '#one-image',
    		focusOnSelect: true, vertical: true,
    		arrows: true,
    		nextArrow: '<i class="slick-arrow fa fa-angle-down"></i>',
    		prevArrow: '<i class="slick-arrow fa fa-angle-up"></i>'
    	});
   //--></script>
        {% else %}   
		<div class="over">
		  <div class="hn">
		    {{ hit }}
		    {{ new }}
		  </div>
		  <ul id="one-image" class="zoom{{ zoom }}" style="width: 100%">
			<li class="zoom"><img src="{{ fix2 }}" title="{{ heading_title }}" alt="{{ heading_title }}" class="img0 one-img" itemprop="image" data-src="{{ popup }}" /></li>
			{% for image in images %}
			<li class="zoom"><img src="{{ image.norm }}" title="{{ heading_title }}" alt="{{ heading_title }}" class="one-img" data-src="{{ image.popup }}"/></li>
			{% endfor %}
		  </ul>
		  <ul id="image-additional" class="bottom-thumb" style="width: 100%">
			<li class="image-additional"><img src="{{ fix }}" title="{{ heading_title }}" alt="{{ heading_title }}" class="fix-img" /></li>
			{% for image in images %}
			<li class="image-additional"><img src="{{ image.thumb }}" data-zoom-image="{{ image.popup }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></li>
			{% endfor %}
		  </ul>
		</div>
		<script type="text/javascript"><!--
			$('#one-image').slick({
				slidesToShow: 1,
				slidesToScroll: 1,
				asNavFor: '#image-additional',
				arrows: false,
				responsive: [
				{
				breakpoint: 767,
					settings: {
					dots: true,
					customPaging : function(slider, i) {return '';}
					}
				}
				] 
			});

			$('#image-additional').slick({
				slidesToShow: {{ madeshop_num_thumb }},
				slidesToScroll: 1,
				asNavFor: '#one-image',
				focusOnSelect: true, 
				arrows: true,
				nextArrow: '<i class="slick-arrow arrow-right fa fa-caret-right"></i>',
				prevArrow: '<i class="slick-arrow arrow-left fa fa-caret-left"></i>',
			}); 

		//--></script>
		 {% endif %} 
        </div>
        {% if column_left or column_right %}
        {% set class = 'col-sm-6' %}
        {% else %}
        {% set class = 'col-sm-4' %}
        {% endif %}
        <div class="col-sm-{{ 12 - madeshop_width_left }}">
          <div class="name-block">
          <h1 itemprop="name">{{ heading_title }}</h1>
          <div class="group-rad">
              {% if iwishlist %}<i onclick="wishlist.add('{{ product_id }}','1');" class="rad-btn small fa fa-heart-o"></i>{% endif %}
              {% if icompare %}<i onclick="compare.add('{{ product_id }}','1');" class="rad-btn small fa fa-align-left"></i>{% endif %}
          </div>
          </div>
           {% if manufacturer %}<a href="{{ manufacturers }}" class="manufacturer" itemprop="brand">{{ manufacturer }}</a>{% endif %}
           {% if pmodel %}{{ text_model }}<span itemprop="sku">{{ model }}</span>{% endif %}
          <div class="price-block" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
		  <a itemprop="url" href="{{ breadlast.href }}" class="hidden">{{ heading_title }}</a>
          <meta itemprop="price" content="{{ nprice }}">
          <meta itemprop="priceCurrency" content="{{ pcode }}">
          <link itemprop="availability" href='http://schema.org/InStock' />
          {% if price %}
          <ul class="list-inline">
            {% if not special %}
            <li><div class="price">{{ price }}</div></li>
            {% else %}
            <li><span class="price">{{ special }}</span></li>
            <li><span style="text-decoration: line-through;">{{ price }}</span></li>
            <li><span class="psale">{{ sale }}</span></li>
            {% endif %}
            {% if tax %}
            <li>{{ text_tax }} {{ tax }}</li>
            {% endif %}
            {% if points %}
            <li>{{ text_points }}{{ points }}</li>
            {% endif %}
            {% if discounts %}
            <li>
              <hr>
            </li>
            {% for discount in discounts %}
            <li>{{ discount.quantity }}{{ text_discount }}{{ discount.price }}</li>
            {% endfor %}
            {% endif %}
          </ul>
          <p>
          {% if points %}
            <p class="reward">{{ text_points }}{{ points }}</p>
            {% endif %}
          {% if reward %}
            <p class="reward">{{ text_reward }} {{ reward }}</p>
          {% endif %}
          </p>
          {{ minprice }}
		  {% endif %}
          </div>
          {% if min_d %}
          <p class="min_d">{{ min_d }}</p>		  
          <div class="go-link" data-url="description-block" onclick="$('a[href=\'#tab-description\']').trigger('click'); return false;">{{ text_more }}</div>
          {% endif %}
          <div id="product">
            {{ variant }}
            {% if options %}
            <div class="options">
            {% for option in options %}
            {% if option.type == 'select' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label olabel" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <select name="option[{{ option.product_option_id }}]" id="input-option{{ option.product_option_id }}" class="form-control inlineb no-border">
                <option value="">{{ text_select }}</option>
                {% for option_value in option.product_option_value %}
                <option value="{{ option_value.product_option_value_id }}" {{ option_value.stock }}>{{ option_value.name }}
                {% if option_value.price %}
                ({{ option_value.price_prefix }}{{ option_value.price }})
                {% endif %}
                </option>
                {% endfor %}
              </select>
            </div>
            {% endif %}
			
            {% if option.type == 'radio' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label olabel">{{ option.name }}</label>
              <div id="input-option{{ option.product_option_id }}" class="inlineb">
                {% for option_value in option.product_option_value %}
                <div class="radio-block">
                    <input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" {{ option_value.stock }} id="in-{{ option_value.product_option_value_id }}" />
                    {% if option_value.image %} 
                    <label for="in-{{ option_value.product_option_value_id }}" class="img-label">
                    <img src="{{ option_value.image }}" alt="{{ option_value.name }}  {% if option_value.price %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" data-toggle="tooltip" title="" data-original-title="{{ option_value.name }} {% if option_value.price %}({{ option_value.price_prefix }}{{ option_value.price }}){% endif %}" class="img-thumbnail" />
                    {% else %}
                    <label for="in-{{ option_value.product_option_value_id }}">
                    {{ option_value.name }}
                    {% if option_value.price %}
                    ({{ option_value.price_prefix }}{{ option_value.price }})
                    {% endif %}
                    {% endif %}                   
                    </label>
                </div>
                {% endfor %}
              </div>
            </div>
            {% endif %}
            {% if option.type == 'checkbox' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label olabel">{{ option.name }}</label>
              <div id="input-option{{ option.product_option_id }}">
                {% for option_value in option.product_option_value %}
                <div class="checkbox">
                  <input type="checkbox" name="option[{{ option.product_option_id }}][]" value="{{ option_value.product_option_value_id }}" {{ option_value.stock }} id="in-{{ option_value.product_option_value_id }}" />
                  <label for="in-{{ option_value.product_option_value_id }}">
                   {% if option_value.image %} <img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" class="img-thumbnail" /> {% endif %}
                    {{ option_value.name }}
                    {% if option_value.price %}
                    ({{ option_value.price_prefix }}{{ option_value.price }})
                   {% endif %}
                  </label>
                </div>
                {% endfor %}
              </div>
            </div>
            {% endif %}
            {% if option.type == 'text' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" placeholder="{{ option.name }}" id="input-option{{ option.product_option_id }}" class="form-control no-border" />
            </div>
            {% endif %}
            {% if option.type == 'textarea' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <textarea name="option[{{ option.product_option_id }}]" rows="5" placeholder="{{ option.name }}" id="input-option{{ option.product_option_id }}" class="form-control no-border">{{ option.value }}</textarea>
            </div>
            {% endif %}
            {% if option.type == 'file' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label">{{ option.name }}</label>
              <button type="button" id="button-upload{{ option.product_option_id }}" data-loading-text="{{ text_loading }}" class="btn btn-default btn-block"><i class="fa fa-upload"></i> {{ button_upload }}</button>
              <input type="hidden" name="option[{{ option.product_option_id }}]" value="" id="input-option{{ option.product_option_id }}" />
            </div>
            {% endif %}
            {% if option.type == 'date' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <div class="input-group date">
                <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" data-date-format="YYYY-MM-DD" id="input-option{{ option.product_option_id }}" class="form-control no-border" />
                <span class="input-group-btn">
                <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
                </span></div>
            </div>
            {% endif %}
            {% if option.type == 'datetime' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <div class="input-group datetime">
                <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" data-date-format="YYYY-MM-DD HH:mm" id="input-option{{ option.product_option_id }}" class="form-control no-border" />
                <span class="input-group-btn">
                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                </span></div>
            </div>
            {% endif %}
            {% if option.type == 'time' %}
            <div class="form-group{% if option.required %} required {% endif %}">
              <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
              <div class="input-group time">
                <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" data-date-format="HH:mm" id="input-option{{ option.product_option_id }}" class="form-control no-border" />
                <span class="input-group-btn">
                <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                </span></div>
            </div>
            {% endif %}
            {% endfor %}
            </div>
            {% endif %}
            {{ size }}
            {% if recurrings %}
            <hr>
            <h3>{{ text_payment_recurring }}</h3>
            <div class="form-group required">
              <select name="recurring_id" class="form-control no-border">
                <option value="">{{ text_select }}</option>
                {% for recurring in recurrings %}
                <option value="{{ recurring.recurring_id }}">{{ recurring.name }}</option>
                {% endfor %}
              </select>
              <div class="help-block" id="recurring-description"></div>
            </div>
            {% endif %}
            <div class="form-group">
            <div class="flex"> 
              <div class="qty" title="{{ entry_qty }}">
			   	<div class="plus"><i class="fa fa-caret-up"></i></div>		 
			  <input type="text" name="quantity" value="{{ minimum }}" size="2" data-max="10" id="input-quantity" class="form-control" />
              <div class="minus"><i class="fa fa-caret-down"></i></div>
			  </div>
              <input type="hidden" name="product_id" value="{{ product_id }}" />
              {% if istock %}
              <button type="button" class="btn made-btn no-stock">{{ istock }}</button>
              {% else %}
              <button type="button" id="button-cart" data-loading-text="{{ text_loading }}" class="btn made-btn">{{ button_cart }}</button>
              {% if madeshop_order %}<button type="button" id="button-icart" data-loading-text="{{ text_loading }}" class="btn made-btn">{{ button_order }}</button>{% endif %}
              {% endif %}
            </div>
            </div>
            {% if minimum > 1 %}
            <div class="alert alert-info"><i class="fa fa-info-circle"></i> {{ text_minimum }}</div>
            {% endif %}
          </div>
          {% if review_status %}
          <ul class="rating list-unstyled">
			{% for i in 1..5 %}
			{% if rating < i %}
			<li class="nocheck"></li>
			{% else %}
			<li class=""></li>
			{% endif %}
			{% endfor %}
	      </ul>
		  <a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); return false;">{{ reviews }}</a>
		  {% if nreviews > 1 %}
		  <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
            <meta itemprop="reviewCount" content="{{ nreviews }}">
            <meta itemprop="ratingValue" content="{{ rating }}">
          </span>
		  {% endif %}
          {% endif %}
          <span class="stock">{{ stock }}</span>
        </div>
      </div>
    </div>
    {{ column_right }}
  </div>
</div>
<div class="tab-block nav">
  <div class="container">
    <ul class="flex-tab nav">
        <li class="active des" data-url="des"><span onclick="$('a[href=\'#tab-description\']').trigger('click');">{{ tab_description }}</span></li>
		{% if tattribute and attribute_groups %}<li class="attr"><span onclick="$('a[href=\'#tab-attribute\']').trigger('click');">{{ tab_attribute }}</span></li>{% endif %}
        {% if review_status %}<li class="rev"><span onclick="$('a[href=\'#tab-review\']').trigger('click');">{{ tab_review }}</span></li>{% endif %}
        {% if madeshop_name0 %}<li class="tab-0"><span onclick="$('a[href=\'#tab-0\']').trigger('click');">{{ madeshop_name0 }}</span></li>{% endif %}
        {% if madeshop_name1 %}<li class="tab-1"><span onclick="$('a[href=\'#tab-1\']').trigger('click');">{{ madeshop_name1 }}</span></li>{% endif %}
        {% if madeshop_name2 %}<li class="tab-2"><span onclick="$('a[href=\'#tab-2\']').trigger('click');">{{ madeshop_name2 }}</span></li>{% endif %}
    </ul>
  </div> 
</div> 
<div class="description-block">
  <div class="container">
    <div class="">
      <ul class="nav made-nav">
        <li class="li active" data-class="des">
          <div class="plus"></div>    
          <a href="#tab-description" data-toggle="tab" class="aclass">{{ tab_description }}</a>
              <div class="tab-pane active" id="tab-description">
                <div class="row">
                  <div class="col-sm-8" itemprop="description">
                  {{ max_d }}
                  </div>
                  {% if not tattribute and attribute_groups %}
                  <div class="col-sm-4">
                    <table class="table attribute{{ madeshop_hattribute }}">
                    {% for attribute_group in attribute_groups %}
                      <thead>
					  <tr>
						<td colspan="2"><strong>{{ attribute_group.name }}</strong></td>
					  </tr>
                      </thead>
					  <tbody>
						  {% for attribute in attribute_group.attribute %}
						  <tr>
							<td>{{ attribute.name }}</td>
							<td>{{ attribute.text }}</td>
						  </tr>
						  {% endfor %}
					  </tbody>
                    {% endfor %}
					<tbody class="tmodel">
                    <tr>
                    <td>{{ text_model }}</td>
                    <td itemprop="sku">{{ model }}</td>
                    </tr>
                    </tbody>
                    </table>
                  </div>
                  {% endif %}
                </div> 
              </div>
        </li>
		{% if tattribute and attribute_groups %}
        <li class="li" data-class="attr">
          <div class="plus"></div>
          <a href="#tab-attribute" data-toggle="tab" class="aclass">{{ tab_attribute }}</a>
          <div class="tab-pane" id="tab-attribute">
          <div class="col-sm-6">
            <table class="table attribute{{ madeshop_hattribute }}">
                    {% for attribute_group in attribute_groups %}
                      <thead>
					  <tr>
						<td colspan="2"><strong>{{ attribute_group.name }}</strong></td>
					  </tr>
                      </thead>
					  <tbody>
						  {% for attribute in attribute_group.attribute %}
						  <tr>
							<td>{{ attribute.name }}</td>
							<td>{{ attribute.text }}</td>
						  </tr>
						  {% endfor %}
					  </tbody>
                    {% endfor %}
					<tbody class="tmodel">
                    <tr>
                    <td>{{ text_model }}</td>
                    <td itemprop="sku">{{ model }}</td>
                    </tr>
                    </tbody>
            </table>
          </div>
          </div>
        </li>
        {% endif %}
        {% if review_status %}
        <li class="li" data-class="rev">
          <div class="plus"></div>
          <a href="#tab-review" data-toggle="tab" class="aclass">{{ tab_review }}</a>
          <div class="tab-pane" id="tab-review">
            <div class="rev-bl">
		      <form class="madeshop-review form-horizontal" id="form-review">
			    <div id="review"></div>
			    {% if review_guest %}
				<div id="review-panel" class="full spanel trans">
				  <div class="close-panel"><div class="container"><i class="fa fa-arrow-up"></i>{{ text_close }}</div></div>
				  <div class="container">
					<div class="table">
					  <div class="table-cell">
						<div class="w65">
						  <div class="form-wrap">
						  <div class="form-group required">
							<div class="col-sm-12">
							  <input type="text" name="name" value="{{ customer_name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control no-border" /> 
							</div>
						  </div>
						  <div class="form-group required">
							<div class="col-sm-12">
							  <textarea name="text" rows="1" placeholder="{{ entry_review }}" id="input-review" class="form-control no-border" onkeyup="textarea_resize(event)"></textarea>
							</div>
						  </div>
						  <div class="form-group required">
							<div class="col-sm-6">{{ entry_rating }}</div>
							<div class="col-sm-6">
								<div class="rate">
									<input type="radio" id="star5" name="rating" value="5">
									<label for="star5" title="5"></label>
									<input type="radio" id="star4" name="rating" value="4">
									<label for="star4" title="4"></label>
									<input type="radio" id="star3" name="rating" value="3">
									<label for="star3" title="3"></label>
									<input type="radio" id="star2" name="rating" value="2">
									<label for="star2" title="2"></label>
									<input type="radio" id="star1" name="rating" value="1">
									<label for="star1" title="1"></label>
								</div>
							</div>
						  </div>
						  {{ captcha }}
						  <div class="buttons clearfix"><button type="submit" id="button-review" data-loading-text="{{ text_loading }}" class="btn made-btn">{{ button_continue }}</button></div>
						  </div>
						</div>
					  </div>
					</div>
				  </div>
				</div>
				<div class="panel-url border-btn" data-spanel="#review-panel">
				{{ text_write }}
				</div>
				{% else %}
					<div class="rev-guest border-btn">{{ text_write }}</div>
				{% endif %}
		      </form>
	        </div>
          </div>
        </li>
        {% endif %}
		{% if madeshop_name0 %}
		<li class="li" data-class="tab-0">
		  <div class="plus"></div>
		  <a href="#tab-0" data-toggle="tab" class="aclass">{{ madeshop_name0 }}</a>
		  <div class="tab-pane" id="tab-0">
			  {{ madeshop_des0 }}
		  </div>
		</li>
		{% endif %}
		{% if madeshop_name1 %}
		<li class="li" data-class="tab-1">
		  <div class="plus"></div>
		  <a href="#tab-1" data-toggle="tab" class="aclass">{{ madeshop_name1 }}</a>
		  <div class="tab-pane" id="tab-1">
			  {{ madeshop_des1 }}
		  </div>
		</li>
		{% endif %}
		{% if madeshop_name2 %}
		<li class="li" data-class="tab-2">
		  <div class="plus"></div>
		  <a href="#tab-2" data-toggle="tab" class="aclass">{{ madeshop_name2 }}</a>
		  <div class="tab-pane" id="tab-2">
			  {{ madeshop_des2 }}
		  </div>
		</li>
		{% endif %}
      </ul>
    </div>
  </div>
</div>
</div>
  {% if products %}
  <div class="rel-block">
  <div class="container">
  <h3>{{ text_related }}</h3>
  <div id="related" class="row-flex module">
    {% set i = 0 %}
	{% for product in products %}
    <div class="product-layout">
      <div class="product-thumb">
        {% if product.rating %}
        <ul class="rating list-unstyled">
	    {% for j in 1..5 %}
          {% if product.rating < j %}
          <li class="nocheck"></li>
          {% else %}
          <li></li>
          {% endif %}
        {% endfor %}
	    </ul>
        {% endif %}
        <div class="sale">{{ product.sale }}</div>
        <div class="image"><a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive rel{{ product.product_id }}" /></a></div>
        <div class="l-icon">
			{% if iwishlist %}<i class="fa fa-heart-o" onclick="wishlist.add('{{ product.product_id }}','rel{{ product.product_id }}');"><span>{{ button_wishlist }}</span></i>{% endif %}
			{% if icompare %}<i class="fa fa-exchange" onclick="compare.add('{{ product.product_id }}','rel{{ product.product_id }}');"><span>{{ button_compare }}</span></i>{% endif %}
			{% if iview %}<i class="fa fa-eye" data-href="{{ product.href }}"><span>{{ button_view }}</span></i>{% endif %}
			{% if icart == 1 and not product.options %}{% if product.istock %}
                    <i class="m-cart no-stock"><div class="picon"><div class="all-icon cart-icon"></div></div><span>{{ text_nostock }}</span></i>
                    {% else %}
                    <i class="m-cart" onclick="cart.add('{{ product.product_id }}','rel{{ product.product_id }}');"><div class="picon"><div class="all-icon cart-icon"></div></div><span>{{ button_cart }}</span></i>
                    {% endif %}{% endif %}
		</div>
        <div class="caption">
          <div class="hp">
		    {{ product.hit }}
		    {{ product.new }}
		   </div>
		  <h4><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 %}
            {% if product.tax %}
              <span class="price-tax">{{ text_tax }} {{ product.tax }}</span>
            {% endif %}
            </p>
          {% endif %}
        </div>
        <div class="more-point">+</div>
        {% if icart == 2 and not product.options %}
	    {% if product.istock %}
				<div class="picon c-icon no-stock" data-toggle="tooltip" title="" data-original-title="{{ text_nostock }}"><div class="all-icon cart-icon"></div></div>
				{% else %}
				<div class="picon c-icon" onclick="cart.add('{{ product.product_id }}','rel{{ product.product_id }}');"><div class="all-icon cart-icon"></div></div>
				{% endif %}
	    {% endif %}
        <div class="info-block">
		  {% if product.attribute_groups %}
		  <ul class="attribute">
		    {% for attribute_group in product.attribute_groups %}
            <tbody>
              {% for attribute in attribute_group.attribute %}
              {% if attribute.attribute_id not in attribute_out %}
              {% if attribute_name %}{{ attribute.name }} -{% endif %}{{ attribute.text }} <span>|</span>
              {% endif %}
              {% endfor %}
            </tbody>
            {% endfor %}
          </ul>
          {% endif %}
          {% if product.options %}
		    <div class="size-block">		
		    {% for option in product.options %}
			  {% if option.option_id == option_name %}
		        {% for option_value in option.product_option_value %}
		        <label class="{{ option_value.quantity < 1 ? ' out' : '' }}"><input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" data-id="{{ product.product_id }}" data-uid="rel{{ product.product_id }}">{{ option_value.name }}</label>
		        {% endfor %}
		      {% endif %}
			{% endfor %}
		    </div>
		  {% endif %}
		  {% if product.min_d %}
		  <div class="des-block">{{ product.min_d }}</div>
		  {% endif %}
		</div>
      </div>
    </div>
    {% endfor %}
  </div>
  </div>
</div>
{% endif %}
<div class="pbottom">{{ content_bottom }}</div>
{% if tags %}
<div class="tag-block">
  <div class="container">
      <p>
        {% for i in 0..tags|length %}
        {% if tags[i].href %}<a href="{{ tags[i].href }}">{{ tags[i].tag }}</a>{% endif %}
        {% endfor %}
      </p>
  </div>
</div>
{% endif %}
<script type="text/javascript"><!--
$('select[name=\'recurring_id\'], input[name="quantity"]').change(function(){
	$.ajax({
		url: 'index.php?route=product/product/getRecurringDescription',
		type: 'post',
		data: $('input[name=\'product_id\'], input[name=\'quantity\'], select[name=\'recurring_id\']'),
		dataType: 'json',
		beforeSend: function() {
			$('#recurring-description').html('');
		},
		success: function(json) {
			$('.alert, .text-danger').remove();
			if (json['success']) {
				$('#recurring-description').html(json['success']);
			}
		}
	});
});
$('body').on('click', '#button-cart, #morder, #button-icart', function(e) {
	$.ajax({
		url: 'index.php?route=madeshop/cart/add',
		type: 'post',
		data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
		dataType: 'json',
		beforeSend: function() {
			$('#button-cart').button('loading');
		},
		complete: function() {
			$('#button-cart').button('reset');
		},
		success: function(json) {
			$('.alert, .text-danger').remove();
			$('.form-group').removeClass('has-error');
			if (json['error']) {
				if (json['error']['option']) {
					for (i in json['error']['option']) {
						var element = $('#input-option' + i.replace('_', '-'));

						element.parent().addClass('has-error');
					}
	
				var options = $('.options').offset().top - 285;
				
				$('html, body').animate({ scrollTop: options }, 'slow');
				}

				if (json['error']['recurring']) {
					$('select[name=\'recurring_id\']').after('<div class="text-danger">' + json['error']['recurring'] + '</div>');
				}

				$("#button-cart").replaceWith('<button type="button" id="button-cart" data-loading-text="{{ text_loading }}" class="btn made-btn btn-danger">{{ error_cart }}</button>');
			}

			if (json['success']) {
				if($(e.target).is('#button-icart')) {
				setTimeout(function () {
				$('#cart-url').click();
				}, 1200);
				setTimeout(function () {
				$('#fast-form-btn').click();
				}, 2200);
				}
				if($(e.target).is('#morder, .cart-icon')) {
                    anim_photo('#cart-url .total', 'himg');
                } else {
	                anim_photo('#cart-url .total', 1);
                }
				setTimeout(function () {
						$('#cart-url .total').replaceWith('<span class="total red">' + json['total']+ '</span>');
					}, 1200);
				
				$('#cart > ul').load('index.php?route=madeshop/cart/info ul li');
				$("#button-cart").replaceWith('<button type="button" id="open-cart" class="btn made-btn">{{ open_cart }}</button>');
			}
		},
        error: function(xhr, ajaxOptions, thrownError) {
            alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
	});
});
$('#product input, #product select').change(function() {
	$("#button-cart, #open-cart").replaceWith('<button type="button" id="button-cart" data-loading-text="{{ text_loading }}" class="btn made-btn">{{ button_cart }}</button>');
				
});
$(document).delegate('#open-cart', 'click', function(e) {
    $('#cart-url').click();
});
$('.date').datetimepicker({
	pickTime: false
});

$('.datetime').datetimepicker({
	pickDate: true,
	pickTime: true
});

$('.time').datetimepicker({
	pickDate: false
});

$('button[id^=\'button-upload\']').on('click', function() {
	var node = this;

	$('#form-upload').remove();

	$('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');

	$('#form-upload input[name=\'file\']').trigger('click');

	if (typeof timer != 'undefined') {
    	clearInterval(timer);
	}

	timer = setInterval(function() {
		if ($('#form-upload input[name=\'file\']').val() != '') {
			clearInterval(timer);
			$.ajax({
				url: 'index.php?route=tool/upload',
				type: 'post',
				dataType: 'json',
				data: new FormData($('#form-upload')[0]),
				cache: false,
				contentType: false,
				processData: false,
				beforeSend: function() {
					$(node).button('loading');
				},
				complete: function() {
					$(node).button('reset');
				},
				success: function(json) {
					$('.text-danger').remove();

					if (json['error']) {
						$(node).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>');
					}

					if (json['success']) {
						alert(json['success']);

						$(node).parent().find('input').val(json['code']);
					}
				},
				error: function(xhr, ajaxOptions, thrownError) {
					alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
				}
			});
		}
	}, 500);
});

$('#review').delegate('.pag-page a', 'click', function(e) {
    e.preventDefault();

    $('#review').fadeOut('slow');

    $('#review').load(this.href);

    $('#review').fadeIn('slow');
});

$('#review').load('index.php?route=madeshop/review_product&pid={{ product_id }}');

$('#form-review').submit(function(e){
e.preventDefault();var form = this;
	$.ajax({
		url: 'index.php?route=product/product/write&product_id={{ product_id }}',
		type: 'post',
		dataType: 'json',
		data: $("#form-review").serialize(),
		beforeSend: function() {
			$('#button-review').button('loading');
		},
		complete: function() {
			$('#button-review').button('reset');
		},
		success: function(json) {
			$('.alert-success, .alert-danger').remove();

			if (json['error']) {
			    alert(json['error']);
			}

			if (json['success']) {
				$('#review-panel .form-wrap').slideUp();
				$('#review-panel .w65').append('<div class="text-center a-success"><i class="fa fa-check-circle"></i><p>' + json['success'] + '</p></div>');
				$('input[name=\'name\']').val('');
				$('textarea[name=\'text\']').val('');
				$('input[name=\'rating\']:checked').prop('checked', false);
				 setTimeout(function () {
					$('body').click();	
				}, 3000);
			}
		}
	});
    grecaptcha.reset();
});

    $(document).ready(function() {
	$('.image-additional:not(.slick-cloned) .fix-img').clone().appendTo(".no-href");
    $('.made-nav li').on('click', function() {
    $('.flex-tab li').removeClass('active');
    var u = $('.'+$(this).attr("data-class"));
    u.addClass('active');
    });

            $('.minus').click(function () {
                var $input = $(this).parent().find('input');
                var max = $input.data('max');
                var count = parseInt($input.val()) - 1;
                count = count < {{ minimum }} ? {{ minimum }} : count;
                if(count<max){
                $input.val(count);
                $input.change();
                }
            });
            $('.plus').click(function () {
                var $input = $(this).parent().find('input');
                var max = $input.data('max');
                if(($input.val())<max){
                $input.val(parseInt($input.val()) + 1);
                $input.change();
                }
            });

	var hash = window.location.hash;
	if (hash) {
		var hashpart = hash.split('#');
		var  vals = hashpart[1].split('-');
		for (i=0; i<vals.length; i++) {
			$('#product').find('select option[value="'+vals[i]+'"]').attr('selected', true).trigger('select');
			$('#product').find('input[type="radio"][value="'+vals[i]+'"]').attr('checked', true).trigger('click');
			$('#product').find('input[type="checkbox"][value="'+vals[i]+'"]').attr('checked', true).trigger('click');
		}
	}
	
    })

	{% if not zoom %}
		var cloned = $('#one-image').find('img').clone();
        var tort = cloned.each(function() {
        $(this).attr("src",$(this).attr("data-src"));
    });
		
    tort.appendTo('#clone');

    $('#clone').slick({
		slidesToShow: 1,
		slidesToScroll: 1,
		infinite: true,
		dots: true,
		customPaging : function(slider, i) {
		return '';
		},
		nextArrow: '<i class="fa fa-chevron-right"></i>',
		prevArrow: '<i class="fa fa-chevron-left"></i>',
		});		


		$(document).delegate('#one-image li', 'click', function(e) {   
			e.preventDefault();
			e.stopPropagation();
	
		var num = $('#one-image li').not('.slick-cloned').index(this);
			$('#clone').slick('slickGoTo', num+1);
	
			$('#modal-url').click();  
		});

        {% else %}
        if ($(window).width() > 767) {
        $('#one-image').addClass('izoom');	
        } else {
		 
        }
         $('#one-image .zoom').zoom(); 
	{% endif %}
	
    $('#related').slick({
 	    infinite: true,
 	    slidesToShow: 5,
        nextArrow: '<i class="slick-arrow arrow-right fa fa-caret-right"></i>',
        prevArrow: '<i class="slick-arrow arrow-left fa fa-caret-left"></i>',
        responsive: [
    {
      breakpoint: 1200,
      settings: {
        slidesToShow: 4,
      }
    },
    {
      breakpoint: 991,
      settings: {
        slidesToShow: 3,
      }
    },
    {
      breakpoint: 767,
      settings: {
        slidesToShow: 2,
      }
    }
    ]
    });	

--></script>
{{ footer }}
