I might want to try this a bit modified version.
In catalogue/common/header.php
Code: Select all
//how many things in cart
$this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0);
In the catalogue/common/header.tpl
Code: Select all
<span id="cart-total"><?php if (isset ($cartcount)) { echo $cartcount; } ?></span>
In catalogue/view/theme/*/template/product/product.tpl find:
Code: Select all
$('#cart > button').html('<i class="fa fa-shopping-cart"></i> ' + json['total']);
add after:
Code: Select all
$('#cart-total').html(json['cartcount']);
In catalogue/controller/checkout/cart.php find:
Code: Select all
$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));
add after:
Code: Select all
$json['cartcount'] = $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0);
find:
Code: Select all
$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));
add after:
Code: Select all
$json['cartcount'] = $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0);
since I forward everyone from cart to checkout (don't show the header in checkout) all the changes made there woun't work in the header except if You refresh the page. It might be like this:
In catalog/view/javascript/common.js find all:
Code: Select all
$('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
add before each:
Code: Select all
$('#cart-total').html(json['cartcount']);
I hope this gives You a clue how to solve this.