File: //home/retile.ru/public_html/catalog/view/theme/unishop2/template/blog/article.twig
{{ header }}
<div id="product-product" class="container">
<div class="breadcrumb-h1 {{ menu_expanded ? ' col-md-offset-3 col-lg-offset-3 col-xxl-offset-4' }}">
<ul class="breadcrumb mobile">
{% for key, breadcrumb in breadcrumbs %}
{% if key + 1 < breadcrumbs|length %}
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
{% else %}
{% if not hide_last_breadcrumb or (hide_last_breadcrumb and key == 1) %}<li>{{ breadcrumb.text }}</li>{% endif %}
{% endif %}
{% endfor %}
</ul>
<h1 class="heading">{{ heading_title }}</h1>
</div>
<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-12' %}
{% else %}
{% set class = ' col-sm-12' %}
{% endif %}
<div class="{{ class }}">
{% 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 %}
<div class="content">
<div class="article-page__description">{{ description }}</div>
{% if review_status %}
<span class="rating">
{% for i in 1..5 %}
<i class="{{ rating < i ? ' far fa-star' : ' fa fa-star' }}"></i>
{% endfor %}
</span>
<br />
<a href="" onclick="gotoReview(); return false;">{{ reviews }}</a> / <a href="" onclick="gotoReviewWrite(); return false;">{{ text_write }}</a>
<hr>
{% endif %}
</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 -->
{% if download_status %}
<div class="blog-info">
{% if downloads %}
<br />
{% for download in downloads %}
<a href="{{ download.href }}" title=""><i class="fa fa-floppy-o"></i> {{ download.name }} {{ download.size }}</a><br>
{% endfor %}
<br />
{% endif %}
</div>
{% endif %}
{% if products %}
<div class="heading">{{ text_related_product }}</div>
<div class="uni-module product-{% set module_id = random() %}{{ module_id }}">
<div class="uni-module__wrapper">
{% for product in products %}
<div class="product-thumb uni-item">
<div class="product-thumb__image" {{ product.special_date_end ? ' data-special-end="'~product.special_date_end~'"' }}>
{% include 'unishop2/template/extension/module/uni_stickers.twig' %}
<a href="{{ product.href }}">
<img src="{{ product.thumb }}" {{ product.additional_image ? ' data-additional="'~product.additional_image~'"' }} alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" />
</a>
</div>
<div class="product-thumb__caption">
<a class="product-thumb__name" href="{{ product.href }}">{{ product.name }}</a>
{% if product.show_description %}
<div class="product-thumb__description description">{{ product.description }}</div>
{% endif %}
{% include 'unishop2/template/extension/module/uni_attributes.twig' %}
{% include 'unishop2/template/extension/module/uni_options.twig' %}
{% include 'unishop2/template/extension/module/uni_quantity_indicator.twig' %}
{% if product.rating >= 0 and show_rating %}
<div class="product-thumb__rating rating">
{% for i in 1..5 %}
<i class="{{ product.rating < i ? 'far fa-star' : 'fa fa-star' }}"></i>
{% endfor %}
{% if product.num_reviews > 0 %}<a class="product-thumb__rating-a uni-badge uni-href" data-href="{{ product.href }}#tab-review">{{ product.num_reviews }}</a>{% endif %}
</div>
{% endif %}
{% if product.price %}
<div class="product-thumb__price price" data-price="{{ product.price_value }}" data-special="{{ product.special_value }}" data-discount="{{ product.discounts }}">
{% if not product.special %}
{{ product.price }}
{% else %}
<span class="price-old">{{ product.price }}</span> <span class="price-new">{{ product.special }}</span>
{% endif %}
</div>
{% if product.tax %}<div class="price-tax">{{ text_tax }} {{ product.tax }}</div>{% endif %}
{% endif %}
<div class="product-thumb__cart cart {{ product.cart_btn_class }}">
{% if product.show_quantity %}
<div class="qty-switch">
<input type="text" name="quantity" value="{{ product.minimum }}" data-minimum="{{ product.minimum }}" class="qty-switch__input form-control" />
<div>
<i class="qty-switch__btn fa fa-plus btn-default"></i>
<i class="qty-switch__btn fa fa-minus btn-default"></i>
</div>
</div>
{% endif %}
<button type="button" class="product-thumb__add-to-cart add_to_cart btn {{ product.cart_btn_class }} {{ product.product_id }}" title="{{ product.cart_btn_text }}" onclick="cart.add({{ product.product_id }}, this)"><i class="{{ product.cart_btn_icon }}"></i><span>{{ product.cart_btn_text }}</span></button>
<button type="button" class="product-thumb__quick-order quick-order btn {{ product.quick_order is empty ? ' hidden' }}" data-toggle="tooltip" title="{{ quick_order_title }}" onclick="quick_order('{{ product.product_id }}');"><i class="{{ quick_order_icon }}"></i>{% if show_quick_order_text %}<span>{{ quick_order_title }}</span>{% endif %}</button>
<button type="button" class="product-thumb__wishlist wishlist {{ wishlist_btn_disabled ? ' hidden' }}" title="{{ button_wishlist }}" onclick="wishlist.add('{{ product.product_id }}');"><i class="far fa-heart"></i></button>
<button type="button" class="product-thumb__compare compare {{ compare_btn_disabled ? ' hidden' }}" title="{{ button_compare }}" onclick="compare.add('{{ product.product_id }}');"><i class="fas fa-align-right"></i></button>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<script>
$('.product-{{ module_id }}').uniModules({
type:'{{type_view ? type_view : 'carousel'}}',
autoheight:['product-thumb__name', 'product-thumb__description', 'product-thumb__option'],
loop:{{products|length > 5 ? 'true' : 'false'}}
});
{% if show_timer %}
$('.product-{{module_id}} .product-thumb__image').each(function() {
var date = $(this).data('special-end');
if(date) {
$(this).uniTimer({
date :''+date+'',
texts :['{{ text_special_day }}','{{ text_special_hour }}','{{ text_special_min }}','{{ text_special_sec }}'],
hideText :false,
hideIsNull:false
});
}
});
{% endif %}
</script>
{% endif %}
{% if articles %}
<div class="heading">{{ text_related }}</div>
<div class="uni-module article-module article-related">
<div class="uni-module__wrapper row-flex">
{% for articles in articles %}
<div class="article-module__item uni-item">
{% if articles.thumb %}
<div class="article-module__image">
<img src="{{ articles.thumb }}" loading="lazy" alt="{{ articles.name }}" title="{{ articles.name }}" data-href="{{ articles.href }}" class="uni-href img-responsive" width="{{ img_width }}" height="{{ img_height }}" />
</div>
{% endif %}
<div class="article-module__description">
<div class="article-module__category-date-viewed">
<a class="article-module__category uni-href" data-href="{{ articles.category_href }}" title="{{ articles.category_name }}">{{ articles.category_name }}</a>
<span class="article-module__date"><i class="fa fa-calendar"></i>{{ articles.date_added }}</span>
<span class="article-module__viewed"><i class="fa fa-eye"></i>{{ articles.viewed }}</span>
<span class="article-module__rating rating">
{% for i in 1..5 %}<i class="{{ article.rating < i ? ' far fa-star' : ' fa fa-star' }}"></i>{% endfor %}
</span>
</div>
<a class="article-module__name" href="{{ articles.href }}" title="{{ articles.name }}">{{ articles.name }}</a>
<div class="article-module__text">
{{ articles.description }}
<a title="{{ text_more }}" data-toggle="tooltip" data-href="{{ articles.href }}" class="article-module__more uni-href">→</a>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<script>
$('.article-related').uniModules({
type:'{{ type_view is defined ? type_view : 'carousel' }}',
items: {0:{items:1},700:{items:3},1050:{items:4},1400:{items:5}},
});
</script>
{% endif %}
{% if review_status %}
<div class="tab-pane" id="tab-review">
<form class="form-horizontal" id="form-review">
<div id="review"></div>
<div class="heading"><span>{{ text_write }}</span></div>
{% if review_guest %}
<div style="padding:0 5px">
<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>
{{ entry_bad }}
<input type="radio" name="rating" value="1" />
<input type="radio" name="rating" value="2" />
<input type="radio" name="rating" value="3" />
<input type="radio" name="rating" value="4" />
<input type="radio" name="rating" value="5" />
{{ 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>
</div>
{% else %}
{{ text_login }}
{% endif %}
</form>
</div>
{% endif %}
</div>
</div>
</div>
{{ content_bottom }}
</div>
{{ column_right }}
</div>
<script>
$('#review').delegate('.pagination a', 'click', function(e) {
e.preventDefault();
$('#review').fadeOut('slow');
$('#review').load(this.href);
$('#review').fadeIn('slow');
});
$('#review').load('index.php?route=blog/article/review&article_id={{ article_id }}');
$('#button-review').on('click', function() {
$.ajax({
url: 'index.php?route=blog/article/write&article_id={{ article_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);
}
}
});
});
$(document).ready(function() {
$('.thumbnails').magnificPopup({
type:'image',
delegate: 'a',
gallery: {
enabled: true
}
});
});
</script>
<script>
$(document).ready(function() {
$('#description').find('a>img').each(function(){
$(this).parent().addClass('gallery');
});
$('#description').magnificPopup({
delegate: 'a.gallery',
type: 'image',
gallery: {
enabled: true
}
});
gotoReview = () => {
offset = $('#form-review').offset();
$('html, body').animate({ scrollTop: offset.top-20 }, 'slow');
}
gotoReviewWrite = () => {
offset = $('#form-review .heading').offset();
$('html, body').animate({ scrollTop: offset.top-20 }, 'slow');
}
});
</script>
{{ footer }}