{{ 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-8' %}
				{% endif %}
				<div class="{{ class }} product_page-left">
					{% if images %}
						<div class="product-gallery">
							<div class="row">
								<div class="col-lg-12 hidden-xs hidden-sm hidden-md text-center">
									<img data-zoom-type="{{ zoom_type }}" width="{{ popup_width }}" height="{{ popup_height }}" id="productZoom" src="{{ images.0.thumb }}" alt="{{ heading_title }}" data-zoom-image="{{ images.0.popup }}"/>
								</div>
								<div class="col-lg-12 hidden-xs hidden-sm hidden-md image-thumb">
									<ul id="productGallery" class="image-additional" data-slide-width="{{ image_additional_width }}">
										{% for image in images %}
											<li>
												<a href="#" data-image="{{ image.thumb }}" data-zoom-image="{{ image.popup }}">
													<img width="{{ image_additional_width }}" height="{{ image_additional_height }}" src="{{ image.additional }}" alt="{{ heading_title }}" />
												</a>
											</li>
										{% endfor %}
									</ul>
								</div>
								<div class="col-xs-12 hidden-lg image-thumb">
									<ul id="productFullGallery" class="image-additional" data-slide-width="{{ image_additional_width }}">
										{% for image in images %}
											<li>
												<a href="{{ image.thumb }}">
													<img width="{{ thumb_width }}" height="{{ thumb_height }}" src="{{ image.thumb }}" alt="{{ heading_title }}" />
												</a>
											</li>
										{% endfor %}
									</ul>
								</div>
							</div>
						</div>
					{% endif %}
				</div>
				{% if column_left or column_right %}
					{%set class = 'col-sm-6' %}
				{% else %}
					{%set class = 'col-sm-4' %}
				{% endif %}
				<div class="{{ class }} product_page-right">
					<div class="general_info product-info">
						<h2 class="product-title">{{ heading_title }}</h2>
						<ul class="list-unstyled">
							{% if manufacturer %}
								<li>{{ text_manufacturer }} <a href="{{ manufacturers }}">{{ manufacturer }}</a></li>
							{% endif %}
							<li>{{ text_model }} {{ model }}</li>
							{% if reward %}
								<li>{{ text_reward }} {{ reward }}</li>
							{% endif %}
							<li>{{ text_stock }} {{ stock }}</li>
						</ul><br>
						{% if price %}
							<div class="price">
								{% if not special %}
									<span>{{ price }}</span>
								{% else %}
									<span class="price-new">{{ special }}</span>
									<span class="price-old">{{ price }}</span>
								{% endif %}
								{% if tax %}
									<span class="price-tax">{{ text_tax }} {{ tax }}</span>
								{% endif %}
								{% if points %}
									<p>{{ text_points }} {{ points }}</p>
								{% endif %}
								{% if discounts %}
									<span>
										<hr>
									</span>
									{% for discount in discounts %}
										<span>{{ discount.quantity }}{{ text_discount }}{{ discount.price }}</span>
									{% endfor %}
								{% endif %}
							</div>
						{% endif %}
						<div id="product">
							{% if options %}
								<hr>
								<h3>{{ text_option }}</h3>
								{% for option in options %}
									{% 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 %}
									{% 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 %}
							{% endif %}
							{% if recurrings %}
								<hr>
								<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">
									{# <label class="control-label" for="input-quantity">{{ entry_qty }}</label> #}
									<a class="counter counter-minus material-design-horizontal39" href='#'></a>
									<input type="text" name="quantity" value="{{ minimum }}" size="2" id="input-quantity" class="form-control"/>
									<input type="hidden" name="product_id" value="{{ product_id }}"/>
									<a class="counter counter-plus material-design-add186" href='#'></a>
									<button type="button" id="button-cart" data-loading-text="{{ text_loading }}" class="btn">{{ button_cart }}</button>
								</div>
							</div>
							<ul class="product-buttons">
								<li>
									<button type="button" class="link" onclick="wishlist.add('{{ product_id }}');"><i class="material-icons-favorite_border"></i><span>{{ button_wishlist }}</span></button>
								</li><br>
								<li>
									<button type="button" class="link" onclick="compare.add('{{ product_id }}');"><i class="material-icons-shuffle"></i><span>{{ button_compare }}</span>
									</button>
								</li>
							</ul>
							{% if minimum > 1 %}
								<div class="alert alert-info"><i class="fa fa-info-circle"></i> {{ text_minimum }}</div>
							{% endif %}
						</div>
						<hr>
						{% if review_status %}
							<div class="rating">
								<p>
									{% for i in 1..5 %}
										{% if product.rating < i %}
											<span class="fa-stack">
												<i class="linearicons-star fa-stack-2x"></i>
											</span>
										{% else %}
											<span class="fa-stack">
												<i class="linearicons-star star-1 fa-stack-2x"></i>
												<i class="linearicons-star fa-stack-2x"></i>
											</span>
										{% endif %}
									{% endfor %} <br>
								</p>
								<span class="review-link review-link-show">
									<a class="link" href="#">{{ reviews }}</a>
								</span><br>
								<span class="review-link review-link-write">
									<a class="link" href="#">{{ text_write }}</a>
								</span>
								
							</div>
						{% endif %}
						<hr>
						<div class="product-share">
							<!-- AddThis Button BEGIN -->
							<div class="addthis_sharing_toolbox"></div>
							<!-- Go to www.addthis.com/dashboard to customize your tools -->
							<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-55e053ac02ebd38e" async="async"></script>
							<!-- AddThis Button END -->
						</div>
					</div>
				</div>
			</div>
			<div class="product_tabs">
				<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 %}
					{% if (video) %}
						<li>
							<a href="#tab-video" data-toggle="tab">
								{{ tab_video }}
							</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 product-reviews" id="tab-review">
							<form class="form-horizontal" id="form-review">
								<div id="review"></div>
								<div class="review-form-title">
									<h3 class="product-section_title" id="reviews_form_title">{{ text_write }}</h3>
								</div>
								<div class="product-review-form" id="reviews_form">
									{% 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 %}
								</div>
							</form>
						</div>
					{% endif %}
					{% if video %}
						<div id="tab-video" class="tab-pane product-video product-section">
							<div class="r_frame">
								{{ video }}
							</div>
							<div class="clearfix"></div>
						</div>
					{% endif %}
				</div>
			</div>
			{% if products %}
				<div class="box related">
					<div class="box-heading">
						<h3>{{ text_related }}</h3>
					</div>
					<div class="swiper-viewport">
						<div class="swiper-pager">
							<div class="swiper-button-next prod-swiper-button-next-{{ module }}"></div>
							<div class="swiper-button-prev prod-swiper-button-prev-{{ module }}"></div>
						</div>
						<div id="product_carousel_prod-{{ module }}" class="swiper-container">
							<div class="swiper-wrapper">
								{% for product in products %}
									<div class="swiper-slide" data-match-height="items-p">
										<div class="product-thumb transition {% if product.options and product.options|length <= 3 %} {{ 'options' }} {% endif %}" data-match-height="itemc-b">
											{% if product.options and product.options|length <= 3 %}
												<div class="product-option-wrap">
													<div class="product-options form-horizontal">
														<div class="options">
															<a class="ajax-overlay_close" href='#'></a>
															<input type="text" name="product_id" value="{{ product.product_id }}" class="form-control hidden"/>
															<h3>{{ text_option }}</h3>
															{% for option in product.options %}
																{% if option.type == 'select' %}
																	<div class="form-group{% if option.required %} required {% endif %}">
																		<label class="control-label" for="input-option{{ option.product_option_id ~ module ~ option_index }}">
																			{{ option.name }}
																		</label>
																		<select name="option[{{ option.product_option_id }}]" id="input-option{{ option.product_option_id ~ module ~ option_index }}" 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 ~ module ~ option_index }}">
																			{% 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 %}
																{% 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 ~ module ~ option_index }}">
																			{% 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 ~ module ~ option_index }}">
																			{{ 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 ~ module ~ option_index }}" 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 ~ module ~ option_index }}">{{ option.name }}</label>
																		<textarea name="option[{{ option.product_option_id }}]" rows="5" placeholder="{{ option.name }}" id="input-option{{ option.product_option_id ~ module ~ option_index }}" 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 ~ module ~ option_index }}" />
																	</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 ~ module ~ option_index }}">{{ 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 ~ module ~ option_index }}" 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 ~ module ~ option_index }}">{{ 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 ~ module ~ option_index }}" 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 ~ module ~ option_index }}">{{ 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 ~ module ~ option_index }}" 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 %}
															<button type="button" class="product-btn-add" onclick="cart.addPopup($(this), {{ product.product_id }});">
																<i class="linearicons-cart"></i>
																<span class="hidden-xs hidden-sm hidden-md">{{ button_cart }}</span>
															</button>
														</div>
													</div>
												</div>
											{% endif %}
											{% if (product.label_new) %}
												<div class="new-pr">{{ text_new }}</div>
											{% endif %}
											{% if (label_sale) %}
												<div class="sale">
													{{ text_sale }}
												</div>
											{% endif %}
											<div class="image">
												{% if (label_discount) %}
													<div class="discount">
														{{ product.label_discount }}
													</div>
												{% endif %}
												<a class="lazy" href="{{ product.href }}" style="padding-bottom: {{ product['img-height'] / product['img-width'] * 100 ~ '%' }}">
													{% if product.additional_thumb %}
														<img width="{{ product['img-width'] }}" height="{{ product['img-height'] }}" alt="{{ product['name'] }}" title="{{ product['name'] }}" class="img-primary" data-src="{{ product['thumb'] }}" src="#"/>
														<img width="{{ product['img-width'] }}" height="{{ product['img-height'] }}" alt="{{ product['name'] }}" title="{{ product['name'] }}" class="img-secondary" data-src="{{ product['additional_thumb'] }}" src="#"/>
													{% else %}
														<img width="{{ product['img-width'] }}" height="{{ product['img-height'] }}" alt="{{ product['name'] }}" title="{{ product['name'] }}" class="img" data-src="{{ product['thumb'] }}" src="#"/>
													{% endif %}
												</a>
											</div>
											<div class="caption">
												{% if product.price %}
													<div 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 %}
													</div>
												{% endif %}
												<div class="name"><a href="{{ product.href }}">{{ product.name }}</a></div>
												<div class="description">{{ product.description }}</div>
												<div class="button-group">
													<button type="button" class="product-btn cart-btn" data-toggle="tooltip" title="{{ button_cart }}" {% if (product.options|length > 3) %} onclick="cart.add('{{ product.product_id }}');" {% else %} onclick="ajaxAdd($(this),{{ product.product_id }});" {% endif %}><i class="linearicons-cart"></i>
													</button>
													<button type="button" class="product-btn" data-toggle="tooltip" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><i class="linearicons-heart"></i></button>
													<button type="button" class="product-btn" data-toggle="tooltip" title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><i class="linearicons-tab"></i></button>
													<button type="button" data-rel="details" class="product-btn quickview" data-toggle="tooltip" title="{{ text_quick }}" data-product="{{ product['product_id'] }}"><i class="linearicons-eye"></i></button>
													{% if product.rating %}
														<div class="rating">
															{% for i in 1..5 %}
																{% if product.rating < i %}
																	<span class="fa-stack">
																		<i class="linearicons-star fa-stack-2x"></i>
																	</span>
																{% else %}
																	<span class="fa-stack">
																		<i class="linearicons-star star-1 fa-stack-2x"></i>
																		<i class="linearicons-star fa-stack-2x"></i>
																	</span>
																{% endif %}
															{% endfor %}
														</div>
													{% endif %}
												</div>
											</div>
										</div>
									</div>
								{% endfor %}
							</div>
						</div>
					</div>
				</div>
			{% endif %}
			{% if tags %}
				<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 %}
			{{ content_bottom }}
		</div>
		{{ column_right }}
	</div>
</div>
<script>
	(function ($) {
		$(document).ready(function () {
			$('.review-link a').click(function (e) {
				e.preventDefault();
				$('.product_tabs a[href="#tab-review"').tab('show');

			});
			$('.review-link-show').click(function () {
				$('html, body').animate({
					'scrollTop': $('.product_tabs').offset().top - ($('#stuck').outerHeight() + 50)
				}, 1000);
			});
			$('.review-link-write').click(function () {
				$('html, body').animate({
					'scrollTop': $('#reviews_form_title').offset().top - ($('#stuck').outerHeight() + 50)
				}, 1000);
				$('#reviews_form_title').addClass('close-tab').parents('#tab-review').find('#reviews_form').slideDown();
			});
			$('.product_tabs li:first-child a').tab('show');

			$('#reviews_form_title').addClass('close-tab');
			$('#reviews_form_title').on("click", function () {
				if ($(this).hasClass('close-tab')) {
					$(this).removeClass('close').parents('#tab-review').find('#reviews_form').slideToggle();
				}
				else {
					$(this).addClass('close-tab').parents('#tab-review').find('#reviews_form').slideToggle();
				}
			});
		});
	})(jQuery);
</script>
<script type="text/javascript">
	document.getElementById('input-quantity').onkeypress = function (e) {
		e = e || event;
		if (e.ctrlKey || e.altKey || e.metaKey) return;
		var chr = getChar(e);
		if (chr == null) return;
		if (chr < '0' || chr > '9') {
			return false;
		}
	}
	function getChar(event) {
		if (event.which == null) {
			if (event.keyCode < 32) return null;
			return String.fromCharCode(event.keyCode)
		}
		if (event.which != 0 && event.charCode != 0) {
			if (event.which < 32) return null;
			return String.fromCharCode(event.which)
		}
		return null;
	}
</script>
<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-dismissible, .text-danger').remove();

				if (json['success']) {
					$('#recurring-description').html(json['success']);
				}
			}
		});
	});
</script>
<script type="text/javascript">
	$('#button-cart').on('click', function() {
		$.ajax({
			url: 'index.php?route=checkout/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-dismissible, .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('_', '-'));

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

					$('.text-danger').parent().addClass('has-error');
				}

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

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

					$('#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
	});
</script>
<script type="text/javascript">
	$('#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);
				}
			}
		});
	});
</script>
<script type="text/javascript">
	$(document).ready(function () {
		$('#product_carousel_prod-{{ module }}').swiper({
			mode: 'horizontal',
			slidesPerView: 3,
			paginationClickable: true,
			nextButton: '.prod-swiper-button-next-{{ module }}',
			prevButton: '.prod-swiper-button-prev-{{ module }}',
			spaceBetween: 30,
			loop: false,
			breakpoints: {
				480: {
					slidesPerView: 1
				},
				767: {
					slidesPerView: 2
				},
				1199: {
					slidesPerView: 3
				}
			}
		});
	});
</script>
{{ footer }}
