catalog/controller/product/product.php
$data['rating'] = (int)$product_info['rating'];
// Expanded rating
$this->load->model('catalog/review');
$review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']);
$estimations = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id']);
$one = 0;
$two = 0;
$three = 0;
$four = 0;
$five = 0;
$rating_sum = 0;
foreach ($estimations as $estimation){
($estimation['rating'] == '1') && $one++;
($estimation['rating'] == '2') && $two++;
($estimation['rating'] == '3') && $three++;
($estimation['rating'] == '4') && $four++;
($estimation['rating'] == '5') && $five++;
$rating_sum += $estimation['rating'];
}
$data['expanded_rating'][] = array(
'one' => round((100/$review_total) * $one),
'two' => round((100/$review_total) * $two),
'three' => round((100/$review_total) * $three),
'four' => round((100/$review_total) * $four),
'five' => round((100/$review_total) * $five),
'rating' => round($rating_sum / $review_total, 1),
'total' => $review_total
);
catalog/view/theme/default/template/product/product.twig
<p>{% for i in 1..5 %}
{% if rating < i %}<span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i></span>{% else %}<span class="fa fa-stack"><i class="fa fa-star fa-stack-1x"></i><i class="fa fa-star-o fa-stack-1x"></i></span>{% endif %}
{% endfor %} <a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); return false;">{{ reviews }}</a> / <a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); return false;">{{ text_write }}</a></p>
<hr>
{% for rating in expanded_rating %}
<p>1 - {{ rating.one }}%</p>
<p>2 - {{ rating.two }}%</p>
<p>3 - {{ rating.three }}%</p>
<p>4 - {{ rating.four }}%</p>
<p>5 - {{ rating.five }}%</p>
<h3>Общий рейтинг - {{ rating.rating }}</h3>
<p>На основании {{ rating.total }} отзывов</p>
{% endfor %}
<hr>
catalog/controller/common/header.php
if (isset($this->request->get['product_id'])){
$data['is_product_page'] = 'Страница продукта с ID - ' . $this->request->get['product_id'];
}
catalog/view/theme/default/template/common/header.(twig/tpl)
для продукта есть обязательное поле Артикул.
Смотрел в admin/controller но там ничего!
validateForm()
из контроллера admin/controller/catalog/product.php
закомментируйте эти строки:if ((utf8_strlen($this->request->post['model']) < 1) || (utf8_strlen($this->request->post['model']) > 64)) {
$this->error['model'] = $this->language->get('error_model');
}
admin/view/template/catalog/recurring_form.twig
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-model">{{ entry_model }}</label>
<div class="col-sm-10">
<input type="text" name="model" value="{{ model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control"/>
{% if error_model %}
<div class="text-danger">{{ error_model }}</div>
{% endif %}</div>
</div>
'weight' => $this->weight->format(($product_info['weight'] + (float)$option_weight) * $product['quantity'], $product_info['weight_class_id'], $this->language->get('decimal_point'), $this->language->get('thousand_point'))
$data['orders'][] = array(
'order_id' => $result['order_id'],
'name' => $result['firstname'] . ' ' . $result['lastname'],
'status' => $result['status'],
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'products' => ($product_total + $voucher_total),
'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
'view' => $this->url->link('account/order/info', 'order_id=' . $result['order_id'], true),
);
$totals = $this->model_account_order->getOrderTotals($result['order_id']);
foreach ($totals as $total) {
if($total['code'] == 'shipping'){
$data['shipping'] = array(
'title' => $total['title'],
'value' => $total['value'],
);
}
}
catalog/controller/common/home.php
перед $this->response->setOutput($this->load->view('common/home', $data));
вставить вот этот код:$data['search'] = $this->load->controller('common/search');
$data['menu'] = $this->load->controller('common/menu');
catalog/view/theme/default/template/information/contact.twig
<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>
<script></script>
$('button[id^=\'button-upload\']').on('click', function() {
var node = this;
$('#form-upload').remove();
$('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');
$('#form-upload input[name=\'file\']').trigger('click');
if (typeof timer != 'undefined') {
clearInterval(timer);
}
timer = setInterval(function() {
if ($('#form-upload input[name=\'file\']').val() != '') {
clearInterval(timer);
$.ajax({
url: 'index.php?route=tool/upload',
type: 'post',
dataType: 'json',
data: new FormData($('#form-upload')[0]),
cache: false,
contentType: false,
processData: false,
beforeSend: function() {
$(node).button('loading');
},
complete: function() {
$(node).button('reset');
},
success: function(json) {
$('.text-danger').remove();
if (json['error']) {
$(node).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>');
}
if (json['success']) {
alert(json['success']);
$(node).parent().find('input').val(json['code']);
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}
}, 500);
});
catalog/controller/checkout/success.php
есть ли там вот эти строчки:if (isset($this->session->data['order_id'])) {
$this->cart->clear();
unset($this->session->data['shipping_method']);
unset($this->session->data['shipping_methods']);
unset($this->session->data['payment_method']);
unset($this->session->data['payment_methods']);
unset($this->session->data['guest']);
unset($this->session->data['comment']);
unset($this->session->data['order_id']);
unset($this->session->data['coupon']);
unset($this->session->data['reward']);
unset($this->session->data['voucher']);
unset($this->session->data['vouchers']);
unset($this->session->data['totals']);
}