Для потомков - решение:
в /catalog/controller/account/wishlist.php
меняем
if ($product_info) {
if (!in_array($this->request->post['product_id'], $this->session->data['compare'])) {
if (count($this->session->data['compare']) >= 4) {
array_shift($this->session->data['compare']);
}
$this->session->data['compare'][] = $this->request->post['product_id'];
}
$json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('product/compare'));
$json['total'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
}
на
if ($product_info) {
if (!in_array($this->request->post['product_id'], $this->session->data['compare'])) {
if (count($this->session->data['compare']) >= 5) {
//array_shift($this->session->data['compare']);
}
if (count($this->session->data['compare']) < 5) {
$this->session->data['compare'][] = $this->request->post['product_id'];
}
}
//$json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('product/compare'));
if (count($this->session->data['compare']) >= 5) {
$json['warning'] = 'В сравнении 5 из 5';
} else {
$json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('product/compare'));
}
$json['total'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
}
Открываем /catalog/view/javascript/common.js
В var compare = { ищем
if (json['success']) {
$('#content').parent().before('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
$('#compare-total').html(json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
}
и после вставляем
if (json['warning']) {
$('#content').parent().before('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['warning'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
$('#compare-total').html(json['total']);
setTimeout(function () { $('.alert-success').fadeOut() }, 4000);
}