Im developing a site for a client and its the first time i've tried to work with opencart so im not 100% sure about the best way to do things, i could do with some advice.
I have added the following code to the header controller in controllers/common/header.php
Code: Select all
if (isset($this->session->data['cart']) && !empty($this->session->data['cart'])) {
$this->data['cart_count'] = array_sum($this->session->data['cart']);
}else{
$this->data['cart_count'] = 0;
}
Is the correct way to go about modifying opencart? It doesn't seem like its very upgrade proof.
Thanks