['checkout'] = $this->url->link('checkout/checkout', '', 'SSL'); $data['contact'] = $this->url->link('information/contact'); $data['telephone'] = $this->config->get('config_telephone'); $status = true; if (isset($this->request->server['HTTP_USER_AGENT'])) { $robots = explode("\n", str_replace(array("\r\n", "\r"), "\n", trim($this->config->get('config_robots')))); foreach ($robots as $robot) { if ($robot && strpos($this->request->server['HTTP_USER_AGENT'], trim($robot)) !== false) { $status = false; break; } } } // Menu $this->load->model('catalog/category'); $this->load->model('catalog/product'); $data['categories'] = array(); $categories = $this->model_catalog_category->getCategories(0); foreach ($categories as $category) { if ($category['top']) { // Level 2 $children_data = array(); $children = $this->model_catalog_category->getCategories($category['category_id']); foreach ($children as $child) { $filter_data = array( 'filter_category_id' => $child['category_id'], 'filter_sub_category' => true ); $children_data[] = array( 'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) ); } // Level 1 $data['categories'][] = array( 'name' => $category['name'], 'children' => $children_data, 'column' => $category['column'] ? $category['column'] : 1, 'href' => $this->url->link('product/category', 'path=' . $category['category_id']) ); } } $data['language'] = $this->load->controller('common/language'); $data['currency'] = $this->load->controller('common/currency'); $data['search'] = $this->load->controller('common/search'); $data['cart'] = $this->load->controller('common/cart'); // For page specific css if (isset($this->request->get['route'])) { if (isset($this->request->get['product_id'])) { $class = '-' . $this->request->get['product_id']; } elseif (isset($this->request->get['path'])) { $class = '-' . $this->request->get['path']; } elseif (isset($this->request->get['manufacturer_id'])) { $class = '-' . $this->request->get['manufacturer_id']; } else { $class = ''; } $data['class'] = str_replace('/', '-', $this->request->get['route']) . $class; } else { $data['class'] = 'common-home'; } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) { return $this->load->view($this->config->get('config_template') . '/template/common/header.tpl', $data); } else { return $this->load->view('default/template/common/header.tpl', $data); } } }