{{ header }}
<div id="product-product" class="container">
    <ul class="breadcrumb">
        {% for breadcrumb in breadcrumbs %}
            <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
        {% endfor %}
    </ul>
    <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 }}">{{ content_top }}
            <div class="row"> {% if column_left or column_right %}
                    {% set class = 'col-sm-6' %}
                {% else %}
                    {% set class = 'col-sm-6' %}
                {% endif %}
                <div class="{{ class }} block-1">
                    {% if use_zoom %}
                        <input type="hidden" id="check-use-zoom" value="1" />
                        <input type="hidden" id="light-box-position" value="1" />
                        <input type="hidden" id="product-identify" value="{{ product_id }}" />
                        <div class="lightbox-container"></div>
                        {% if use_swatches %}
                            <div class="product-zoom-image">
                                {% if thumb %}
                                    <a href="{{ popup }}" class="cloud-zoom main-image" id="product-cloud-zoom" style="width: {{ thumb_dimension.width }}px; height: {{ thumb_dimension.height }}px;"
                                       rel="{% if zoom_config.bg_status %} tint:'{{ zoom_config.bg_color }}',tintOpacity:{{ zoom_config.bg_opacity }},{% endif %}
                                            {% if zoom_config.title_status %} showTitle: true {% else %} showTitle: false {% endif %},
                                            zoomWidth:{{ thumb_dimension.width }},zoomHeight:{{ thumb_dimension.height }},
                                            {% if zoom_config.position == 'inside' %} position:'inside', adjustX: 0 {% else %} adjustX: {{ zoom_config.space }} {% endif %}">
                                        <img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" />
                                    </a>
                                {% endif %}
                            </div>
                            <div class="additional-images owl-carousel owl-theme">
                                {% if thumb %}
                                    <div class="item">
                                        <a class="cloud-zoom-gallery sub-image" id="product-image-default" href="{{ popup }}" title="{{ heading_title }}"
                                           rel="useZoom: 'product-cloud-zoom', smallImage: '{{ thumb }}'" data-pos="1">
                                            <img src="{{ small_image }}" title="{{ heading_title }}" alt="{{ heading_title }}" />
                                        </a>
                                    </div>
                                {% endif %}
                                {% if images %}
                                    {% set img_count = 2 %}
                                    {% for image in images %}
                                        <div class="item">
                                            <a class="cloud-zoom-gallery sub-image" id="product-image-options-{{ image.product_option_value_id }}" href="{{ image.popup }}" title="{{ heading_title }}"
                                               rel="useZoom: 'product-cloud-zoom', smallImage: '{{ image.product_image_option }}'" data-pos="{{ img_count }}">
                                                <img src="{{ image.thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" />
                                            </a>
                                        </div>
                                        {% set img_count = img_count + 1 %}
                                    {% endfor %}
                                {% endif %}
                            </div>

                        {% else %}
                            <div class="product-zoom-image">
                                {% if thumb %}
                                    <a href="{{ popup }}" class="cloud-zoom main-image" id="product-cloud-zoom" style="width: {{ thumb_dimension.width }}px; height: {{ thumb_dimension.height }}px;"
                                       rel="{% if zoom_config.bg_status %} tint:'{{ zoom_config.bg_color }}',tintOpacity:{{ zoom_config.bg_opacity }},{% endif %}
                                            {% if zoom_config.title_status %} showTitle: true {% else %} showTitle: false {% endif %},
                                            zoomWidth:{{ thumb_dimension.width }},zoomHeight:{{ thumb_dimension.height }},
                                            adjustX: {{ zoom_config.space }},
                                            {% if zoom_config.position == 'inside' %} position:'inside' {% endif %}">
                                        <img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" />
                                    </a>
                                {% endif %}
                            </div>
                            <div class="additional-images owl-carousel owl-theme">
                                {% if thumb %}
                                    <div class="item">
                                        <a class="cloud-zoom-gallery sub-image" href="{{ popup }}" title="{{ heading_title }}"
                                           rel="useZoom: 'product-cloud-zoom', smallImage: '{{ thumb }}'" data-pos="1">
                                            <img src="{{ small_image }}" title="{{ heading_title }}" alt="{{ heading_title }}" />
                                        </a>
                                    </div>
                                {% endif %}
                                {% if images %}
                                    {% set img_count = 2 %}
                                    {% for image in images %}
                                        <div class="item">
                                            <a class="cloud-zoom-gallery sub-image" href="{{ image.popup }}" title="{{ heading_title }}"
                                               rel="useZoom: 'product-cloud-zoom', smallImage: '{{ image.product_image_option }}'" data-pos="{{ img_count }}">
                                                <img src="{{ image.thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" />
                                            </a>
                                        </div>
                                        {% set img_count = img_count + 1 %}
                                    {% endfor %}
                                {% endif %}
                            </div>
                        {% endif %}
                    {% else %}
                        <input type="hidden" id="check-use-zoom" value="0" />
                        {% if use_swatches %}
                            {% if thumb or images %}
                                <ul class="thumbnails" id="swatches-image-container">
                                    {% if thumb %}
                                        <li><a class="thumbnail swatches-image" href="{{ popup }}" title="{{ heading_title }}"><img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></a></li>
                                    {% endif %}
                                    {% if images %}
                                        {% for image in images %}
                                            <li class="image-additional"><a class="thumbnail" href="{{ image.popup }}" title="{{ heading_title }}"> <img src="{{ image.thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></a></li>
                                        {% endfor %}
                                    {% endif %}
                                </ul>
                                {% if thumb %}
                                    <input type="hidden" id="product-image-default" data-thumb="{{ thumb }}" data-popup="{{ popup }}" />
                                {% endif %}
                                {% if images %}
                                    {% for image in images %}
                                        <input type="hidden" id="product-image-options-{{ image.product_option_value_id }}" data-thumb="{{ image.product_image_option }}" data-popup="{{ image.popup }}" />
                                    {% endfor %}
                                {% endif %}
                            {% endif %}
                        {% else %}
                            {% if thumb or images %}
                                <ul class="thumbnails">
                                    {% if thumb %}
                                        <li><a class="thumbnail" href="{{ popup }}" title="{{ heading_title }}"><img src="{{ thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></a></li>
                                    {% endif %}
                                    {% if images %}
                                        {% for image in images %}
                                            <li class="image-additional"><a class="thumbnail" href="{{ image.popup }}" title="{{ heading_title }}"> <img src="{{ image.thumb }}" title="{{ heading_title }}" alt="{{ heading_title }}" /></a></li>
                                        {% endfor %}
                                    {% endif %}
                                </ul>
                            {% endif %}
                        {% endif %}
                    {% endif %}
                </div>
                {% if column_left or column_right %}
                    {% set class = 'col-sm-6' %}
                {% else %}
                    {% set class = 'col-sm-6' %}
                {% endif %}
                <div class="{{ class }} block-2">
                    <h1 class="product-name">{{ heading_title }}</h1>
					{% if review_status %}
						<div class="ratings">
							<div class="rating-box">
							{% for i in 1..5 %}
								{% if rating == i %}
								{% set class_r = "rating"~i %}
								<div class="{{ class_r }}">rating</div>
								{% endif %}
							{% endfor %}
							</div>
							<a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); $('body,html').animate({scrollTop: $('.block-3 .nav-tabs').offset().top}, 800); return false;">{{ reviews }}</a><span>|</span><a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); $('body,html').animate({scrollTop: $('.block-3 .nav-tabs').offset().top}, 800); return false;">{{ text_write }}</a>
						</div>												            
					{% endif %}
                    {% if price %}
                        <ul class="list-unstyled">
							{% if not special %}
							<li class="price-product">
							  <span>{{ price }}</span>
							</li>
							{% else %}
							<li class="price-product"><span class="price-new">{{ special }}</span><span class="price-old">{{ price }}</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>
                    {% endif %}
					<ul class="list-unstyled">
						{% if manufacturer %}
						<li>{{ text_manufacturer }} <a href="{{ manufacturers }}"><span class="ex-text">{{ manufacturer }}</span></a></li>
						{% endif %}
						<li>{{ text_model }} <span class="ex-text">{{ model }}</span></li>
						{% if reward %}
						<li>{{ text_reward }} <span class="ex-text">{{ reward }}</span></li>
						{% endif %}
						<li>{{ text_stock }} <span class="ex-text">{{ stock }}</span></li>
					</ul>
					<p class="short-des">
						{{ short_description }}
					</p>
                    <div id="product"> {% if options %}
					<div class="option-container">
                            <h3>{{ text_option }}</h3>
                            {% for option in options %}
                                {% if use_swatches %}
                                    {% if option.type == 'select' %}
                                        {% if option.option_id == swatches_option %}
                                            <div class="form-group{% if option.required %} required {% endif %}">
                                                <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
                                                <ul class="ul-swatches-colors" data-product-option="{{ option.product_option_id }}" data-type="select">
                                                    {% for option_value in option.product_option_value %}
                                                    <li class="swatches-options">
                                                        <a href="javascript:void(0);" onclick="swatches.changeOption($(this));" title="{{ option_value.name }} {% if option_value.price %}({{ option_value.price_prefix }}{{ option_value.price }}){% endif %}"
                                                            style="{% if option_value.image %} width: {{ icon_swatches_width }}px; height: {{ icon_swatches_height }}px;
                                                            background-image: url('{{ option_value.image }}') {% endif %}"
                                                            data-product-option-value-id="{{ option_value.product_option_value_id }}">{% if not option_value.image %} {{ option_value.name }} {% endif %}</a>
                                                    </li>
                                                    {% endfor %}
                                                    <li class="swatches-info"></li>
                                                </ul>
                                                <select name="option[{{ option.product_option_id }}]" id="input-option{{ option.product_option_id }}" class="form-control option-swatches">
                                                    <option value="0">{{ text_select }}</option>
                                                    {% for option_value in option.product_option_value %}
                                                        <option value="{{ option_value.product_option_value_id }}">{{ option_value.name }}
                                                            {% if option_value.price %}
                                                                ({{ option_value.price_prefix }}{{ option_value.price }})
                                                            {% endif %} </option>
                                                    {% endfor %}
                                                </select>
                                            </div>
                                        {% else %}
                                            <div class="form-group{% if option.required %} required {% endif %}">
                                                <label class="control-label" 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">
                                                    <option value="">{{ text_select }}</option>
                                                    {% for option_value in option.product_option_value %}
                                                        <option value="{{ option_value.product_option_value_id }}">{{ option_value.name }}
                                                            {% if option_value.price %}
                                                                ({{ option_value.price_prefix }}{{ option_value.price }})
                                                            {% endif %} </option>
                                                    {% endfor %}
                                                </select>
                                            </div>
                                        {% endif %}
                                    {% endif %}
                                    {% if option.type == 'radio' %}
                                        {% if option.option_id == swatches_option %}
                                            <div class="form-group{% if option.required %} required {% endif %}">
                                                <label class="control-label">{{ option.name }}</label>
                                                <ul class="ul-swatches-colors" data-product-option="{{ option.product_option_id }}" data-type="radio">
                                                    {% for option_value in option.product_option_value %}
                                                        <li class="swatches-options">
                                                            <a href="javascript:void(0);" onclick="swatches.changeOption($(this));" title="{{ option_value.name }} {% if option_value.price %}({{ option_value.price_prefix }}{{ option_value.price }}){% endif %}"
                                                               style="{% if option_value.image %} width: {{ icon_swatches_width }}px; height: {{ icon_swatches_height }}px;
                                                        background-image: url('{{ option_value.image }}') {% endif %}"
                                                               data-product-option-value-id="{{ option_value.product_option_value_id }}">{% if not option_value.image %} {{ option_value.name }} {% endif %}</a>
                                                        </li>
                                                    {% endfor %}
                                                    <li class="swatches-info"></li>
                                                </ul>
                                                <div class="option-swatches" id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
                                                        <div class="radio">
                                                            <label>
                                                                <input type="radio" class="radio-option-value" id="radio-option-value-{{ option_value.product_option_value_id }}" name="option[{{ option.product_option_id }}]" value="{{ 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>
                                        {% else %}
                                            <div class="form-group{% if option.required %} required {% endif %}">
                                                <label class="control-label">{{ option.name }}</label>
                                                <div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
                                                        <div class="radio">
                                                            <label>
                                                                <input type="radio" name="option[{{ option.product_option_id }}]" value="{{ 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 %}
                                    {% endif %}
                                {% else %}
                                    {% if option.type == 'select' %}
                                        <div class="form-group{% if option.required %} required {% endif %}">
                                            <label class="control-label" 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">
                                                <option value="">{{ text_select }}</option>
                                                {% for option_value in option.product_option_value %}
                                                    <option value="{{ option_value.product_option_value_id }}">{{ 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">{{ option.name }}</label>
                                            <div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
                                                    <div class="radio">
                                                        <label>
                                                            <input type="radio" name="option[{{ option.product_option_id }}]" value="{{ 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 %}
                                {% endif %}
                                {% if option.type == 'checkbox' %}
                                    <div class="form-group{% if option.required %} required {% endif %}">
                                        <label class="control-label">{{ option.name }}</label>
                                        <div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
                                                <div class="checkbox">
                                                    <label>
                                                        <input type="checkbox" name="option[{{ option.product_option_id }}][]" value="{{ 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" />
                                    </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">{{ 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" />
                <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" />
                <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" />
                <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 %}
                        {% if recurrings %}
                            <h3>{{ text_payment_recurring }}</h3>
                            <div class="form-group required">
                                <select name="recurring_id" class="form-control">
                                    <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="quantity-box">
								<label class="control-label" for="input-quantity">{{ entry_qty }}</label>
								<div class="quantity-content">
									<input type="button" id="plus" value="&#43;" class="form-control"/>
									<input type="text" name="quantity" value="{{ minimum }}" size="2" id="input-quantity" class="form-control" />					
									<input type="button" id="minus" value="-" class="form-control" />
								</div>
							</div>
							<input type="hidden" name="product_id" value="{{ product_id }}" />
							<div class="product-actions">
								<button type="button" id="button-cart" data-loading-text="{{ text_loading }}" class="btn">{{ button_cart }}</button>
								<div class="wishlist-compare">
									<button class="btn-wishlist btn btn-default" type="button" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product_id }}');">{{ button_wishlist }}</button>
									<button class="btn-compare btn btn-default" type="button" title="{{ button_compare }}" onclick="compare.add('{{ product_id }}');">{{ button_compare }}</button>
								</div>
							</div>
                        </div>
                        {% if minimum > 1 %}
							<div class="clearfix"></div>
                            <div class="alert alert-info"><i class="fa fa-info-circle"></i> {{ text_minimum }}</div>
                        {% endif %}</div>
					{% if tags %}
						<div class="clearfix"></div>
						<p>{{ text_tags }}
							{% for i in 0..tags|length %}
								{% if i < (tags|length - 1) %} <a href="{{ tags[i].href }}">{{ tags[i].tag }}</a>,
								{% else %} <a href="{{ tags[i].href }}">{{ tags[i].tag }}</a> {% endif %}
							{% endfor %}
						</p>
					{% endif %}
                    {% if review_status %}
						<div class="clearfix"></div>
						<!-- AddThis Button BEGIN -->
						<div class="addthis_toolbox addthis_default_style" data-url="{{ share }}"><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> <a class="addthis_button_tweet"></a> <a class="addthis_button_pinterest_pinit"></a> <a class="addthis_counter addthis_pill_style"></a></div>
						<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-515eeaf54693130e"></script>
						<!-- AddThis Button END -->
                    {% endif %}
			</div>
            </div>
			<div class="block-3">
				<div class="block-3-content">
					<ul class="nav nav-tabs">
						<li class="active"><a href="#tab-description" data-toggle="tab">{{ tab_description }}</a></li>
						{% if attribute_groups %}
							<li><a href="#tab-specification" data-toggle="tab">{{ tab_attribute }}</a></li>
						{% endif %}
						{% if review_status %}
							<li><a href="#tab-review" data-toggle="tab">{{ tab_review }}</a></li>
						{% endif %}
					</ul>
					<div class="tab-content">
						<div class="tab-pane active" id="tab-description">{{ description }}</div>
						{% if attribute_groups %}
							<div class="tab-pane" id="tab-specification">
								<table class="table table-bordered">
									{% 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 %}
								</table>
							</div>
						{% endif %}
						{% if review_status %}
							<div class="tab-pane" id="tab-review">
								<form class="form-horizontal" id="form-review">
									<div id="review"></div>
									<h2>{{ text_write }}</h2>
									{% if review_guest %}
										<div class="form-group required">
											<div class="col-sm-12">
												<label class="control-label" for="input-name">{{ entry_name }}</label>
												<input type="text" name="name" value="{{ customer_name }}" id="input-name" class="form-control" />
											</div>
										</div>
										<div class="form-group required">
											<div class="col-sm-12">
												<label class="control-label" for="input-review">{{ entry_review }}</label>
												<textarea name="text" rows="5" id="input-review" class="form-control"></textarea>
												<div class="help-block">{{ text_note }}</div>
											</div>
										</div>
										<div class="form-group required">
											<div class="col-sm-12">
												<label class="control-label">{{ entry_rating }}</label>
												&nbsp;&nbsp;&nbsp; {{ entry_bad }}&nbsp;
												<input type="radio" name="rating" value="1" />
												&nbsp;
												<input type="radio" name="rating" value="2" />
												&nbsp;
												<input type="radio" name="rating" value="3" />
												&nbsp;
												<input type="radio" name="rating" value="4" />
												&nbsp;
												<input type="radio" name="rating" value="5" />
												&nbsp;{{ entry_good }}</div>
										</div>
										{{ captcha }}
										<div class="buttons clearfix">
											<div class="pull-right">
												<button type="button" id="button-review" data-loading-text="{{ text_loading }}" class="btn btn-primary">{{ button_continue }}</button>
											</div>
										</div>
									{% else %}
										{{ text_login }}
									{% endif %}
								</form>
							</div>
						{% endif %}
					</div>
				</div>
			</div>
            {{ content_bottom }}</div>
        {{ column_right }}
		</div>
</div>
{% if products %}
<div class="related-products">
	<div class="container">
			<div class="module-description">
			  {{ module_description }}
			</div>
			<div class="module-title">
				<h2>{{ text_related }}</h2>
			</div>
			<div class="related-container owl-carousel owl-theme">
			{% set rows = 1 %}
			{% set count = 0 %}
			{% for product in products %}
				{% if count % rows == 0 %}
				<div class="row_items">
				{% endif %}
				{% set count = count + 1 %}
					<div class="product-layout product-grid">
						<div class="product-thumb transition">
							<div class="item-inner">
								<div class="image">
									<a href="{{ product.href }}">
										{% if 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>
									{% if product.special %}
										<div class="label-product label_sale">{{ text_label_sale }}</div>
										{% endif %}
									{% if product.is_new %}
									<div class="label-product label_new"><span>{{ text_label_new }}</span></div>
									{% endif %}
									<div class="actions">
										<div class="add-to-links">
											<div class="wishlist">
												<button type="button" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><span>{{ button_wishlist }}</span></button>
											</div>
											<div class="compare">
												<button type="button" title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><span>{{ button_compare }}</span></button>
											</div>
											<div class="cart">
												<button type="button" title="{{ button_cart }}" onclick="cart.add('{{ product.product_id }}');"><span>{{ button_cart }}</span></button>
											</div>
											<div class="qv-button-container">
												{% if use_quickview %}
												<button type="button" title="{{ button_quickview }}" onclick="ocquickview.ajaxView('{{ product.href }}')"><span>{{ button_quickview }}</span></button>
												{% endif %}
											</div>
										</div>
									</div>
								</div><!-- image -->
								<div class="caption">
									{% if product.manufacturer %}
									<p class="manufacture-product">
										<a href="{{ product.manufacturers }}">{{ product.manufacturer }}</a>
									</p>
									{% endif %}
									{% if product.rating>=0 %}
									<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 %}
										<!-- <span class="text-rating">{{ "(" }}{{ product.rating }}{{ ")" }}</span> -->
										</div>
									</div>					
									{% endif %}
									<h4 class="product-name"><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><!-- caption -->
							</div>
						</div><!-- product-thumb -->
					</div>
				{% if (count % rows == 0) or (count == products|length ) %}
				</div>
				{% endif %}
			{% endfor %}
		</div>
	</div>
</div>
{% endif %}
<script type="text/javascript"><!--
    $('#product-product select[name=\'recurring_id\'], #product-product input[name="quantity"]').change(function(){
        $.ajax({
            url: 'index.php?route=product/product/getRecurringDescription',
            type: 'post',
            data: $('#product-product input[name=\'product_id\'], #product-product input[name=\'quantity\'], #product-product select[name=\'recurring_id\']'),
            dataType: 'json',
            beforeSend: function() {
                $('#product-product #recurring-description').html('');
            },
            success: function(json) {
                $('#product-product .alert-dismissible, .text-danger').remove();

                if (json['success']) {
                    $('#product-product #recurring-description').html(json['success']);
                }
            }
        });
    });
    //--></script>
<script type="text/javascript"><!--
    $('#product-product #button-cart').on('click', function() {
        $.ajax({
            url: 'index.php?route=checkout/cart/add',
            type: 'post',
            data: $('#product-product #product input[type=\'text\'], #product-product #product input[type=\'hidden\'], #product-product #product input[type=\'radio\']:checked, #product-product #product input[type=\'checkbox\']:checked, #product-product #product select, #product-product #product textarea'),
            dataType: 'json',
            beforeSend: function() {
                $('#product-product #button-cart').button('loading');
            },
            complete: function() {
                $('#product-product #button-cart').button('reset');
            },
            success: function(json) {
                $('#product-product .alert-dismissible, .text-danger').remove();
                $('#product-product .form-group').removeClass('has-error');

                if (json['error']) {
                    if (json['error']['option']) {
                        for (i in json['error']['option']) {
                            var element = $('#product-product #input-option' + i.replace('_', '-'));

                            if (element.parent().hasClass('input-group')) {
                                element.parent().after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
                            } else {
                                element.after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
                            }
                        }
                    }

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

                    // Highlight any found errors
                    $('#product-product .text-danger').parent().addClass('has-error');
                }

                if (json['success']) {
                    $('body').before('<div class="alert alert-success alert-dismissible">' + json['success'] + '<button type="button" class="close" data-dismiss="alert">&times;</button></div>');

                    $('#cart > button').html('<i class="icon-basket-loaded icons"></i><span id="cart-total">' + json['total'] + '</span>');

                    $('html, body').animate({ scrollTop: 0 }, 'slow');

                    $('#cart > ul').load('index.php?route=common/cart/info ul li');
                }
            },
            error: function(xhr, ajaxOptions, thrownError) {
                alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
            }
        });
    });
    //--></script>
<script type="text/javascript"><!--
    $('.date').datetimepicker({
        language: '{{ datepicker }}',
        pickTime: false
    });

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

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

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

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

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

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

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

        timer = setInterval(function() {
            if ($('#product-product #form-upload input[name=\'file\']').val() != '') {
                clearInterval(timer);

                $.ajax({
                    url: 'index.php?route=tool/upload',
                    type: 'post',
                    dataType: 'json',
                    data: new FormData($('#product-product #form-upload')[0]),
                    cache: false,
                    contentType: false,
                    processData: false,
                    beforeSend: function() {
                        $(node).button('loading');
                    },
                    complete: function() {
                        $(node).button('reset');
                    },
                    success: function(json) {
                        $('#product-product .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);
    });
    //--></script>
<script type="text/javascript"><!--
	$('.related-container').owlCarousel({
		items: 5,
		nav: true,
		dots: false,
		navSpeed: 1000,
		margin: 10,
		responsive:{
			0:{
				items: 1
			},
			481:{
				items: 2
			},
			769:{
				items: 4
			},
			1024:{
				items: 4
			},
			1200:{
				items: 5
			},
        },
		navText : ['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>'],
	});
    $('#review').delegate('.pagination a', 'click', function(e) {
        e.preventDefault();

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

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

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

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

    $('#button-review').on('click', function() {
        $.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-dismissible').remove();

                if (json['error']) {
                    $('#review').after('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
                }

                if (json['success']) {
                    $('#review').after('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');

                    $('input[name=\'name\']').val('');
                    $('textarea[name=\'text\']').val('');
                    $('input[name=\'rating\']:checked').prop('checked', false);
                }
            }
        });
    });

    {% if not use_zoom %}
    $(document).ready(function() {
        $('.thumbnails').magnificPopup({
            type:'image',
            delegate: 'a',
            gallery: {
                enabled: true
            }
        });
    });
    {% endif %}
	
	var minimum = {{ minimum }};
	$("#product-product #input-quantity").change(function(){
		if ($(this).val() < minimum) {
		  alert("Minimum Quantity: "+minimum);
		  $("#product-product #input-quantity").val(minimum);
		}
	});
	// increase number of product
	function minus(minimum){
		var currentval = parseInt($("#product-product #input-quantity").val());
		$("#product-product #input-quantity").val(currentval-1);
		if($("#product-product #input-quantity").val() <= 0 || $("#product-product #input-quantity").val() < minimum){
		  alert("Minimum Quantity: "+minimum);
		  $("#product-product #input-quantity").val(minimum);
		}
	};
	// decrease of product
	function plus(){
		var currentval = parseInt($("#product-product #input-quantity").val());
		$("#product-product #input-quantity").val(currentval+1);
	};
	$('#product-product #minus').click(function(){
		minus(minimum);
	});
	$('#product-product #plus').click(function(){
		plus();
	});
    //--></script>
{{ footer }} 
