Это не полное решение.
При обновлении аяксом опенкарт использует другие переменные.
Плюс, непонятно, зачем убрали вывод суммы - вроде, ТС этого не просил :-)
Полный вариант
В catalog\controller\common\cart.php заменяем
$data['text_items'] = sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total));
на
$count = $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0);
function getWord($number, $suffix) {
$keys = array(2, 0, 1, 1, 1, 2);
$mod = $number % 100;
$suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)];
return $suffix[$suffix_key];
}
$text_items1 = $this->language->get('text_items1');
$text_items2 = $this->language->get('text_items2');
$text_items5 = $this->language->get('text_items5');
$array = array($text_items1, $text_items2, $text_items5);
$currency = $this->currency->format($total);
$data['text_items'] = $count .' '. getWord($count, $array).' - '.$currency;
а в \catalog\language\russian\common\cart.php добавляем
$_['text_items1'] = 'товар';
$_['text_items2'] = 'товара';
$_['text_items5'] = 'товаров';
Теперь аналогично надо сделать для аякс-запросов:
в файле \catalog\controller\checkout\cart.php ДВА раза надо заменить
$json['total'] = sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total));
на
$count = $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0);
function getWord($number, $suffix) {
$keys = array(2, 0, 1, 1, 1, 2);
$mod = $number % 100;
$suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)];
return $suffix[$suffix_key];
}
$text_items1 = $this->language->get('text_items1');
$text_items2 = $this->language->get('text_items2');
$text_items5 = $this->language->get('text_items5');
$array = array($text_items1, $text_items2, $text_items5);
$currency = $this->currency->format($total);
$json['total'] = $count .' '. getWord($count, $array).' - '.$currency;
И, соответственно, в \catalog\language\russian\checkout добавляем
$_['text_items1'] = 'товар';
$_['text_items2'] = 'товара';
$_['text_items5'] = 'товаров';
Проверено на ОС 2.102, работает.