Witam,
mam taki problem. Tworze sobie stronę i opieram się na opensource. Mam tam menu dropdown z kategoriami, póżniej mam podkategorie i jeszcze podpodkategorie które się niestety już nie pokazuję na tym menu dropdown. Problem jest w tym, że te dodatkowe kategorie trzeba dodać w php, którego ja kompletnie nie znam... sciana.gif Dodanie listy w css, to spoko, ale przy tym php, trzeba to jakoś też opisać, bo jest baza danych. Z tego co wiem, jakieś to strasznie trudne nie jest, ale dla mnie to czrna magia...
Tutaj kod php:

  1. <?php
  2. class ControllerCommonHeader extends Controller {
  3. protected function index() {
  4. $this->data['title'] = $this->document->getTitle();
  5.  
  6. if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
  7. $this->data['base'] = $this->config->get('config_ssl');
  8. } else {
  9. $this->data['base'] = $this->config->get('config_url');
  10. }
  11.  
  12. $this->data['description'] = $this->document->getDescription();
  13. $this->data['keywords'] = $this->document->getKeywords();
  14. $this->data['links'] = $this->document->getLinks();
  15. $this->data['styles'] = $this->document->getStyles();
  16. $this->data['scripts'] = $this->document->getScripts();
  17. $this->data['lang'] = $this->language->get('code');
  18. $this->data['direction'] = $this->language->get('direction');
  19. $this->data['google_analytics'] = html_entity_decode($this->config->get('config_google_analytics'), ENT_QUOTES, 'UTF-8');
  20.  
  21. $this->language->load('common/header');
  22.  
  23. if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
  24. $server = HTTPS_IMAGE;
  25. } else {
  26. $server = HTTP_IMAGE;
  27. }
  28.  
  29. if ($this->config->get('config_icon') && file_exists(DIR_IMAGE . $this->config->get('config_icon'))) {
  30. $this->data['icon'] = $server . $this->config->get('config_icon');
  31. } else {
  32. $this->data['icon'] = '';
  33. }
  34.  
  35. $this->data['name'] = $this->config->get('config_name');
  36.  
  37. if ($this->config->get('config_logo') && file_exists(DIR_IMAGE . $this->config->get('config_logo'))) {
  38. $this->data['logo'] = $server . $this->config->get('config_logo');
  39. } else {
  40. $this->data['logo'] = '';
  41. }
  42.  
  43. // Calculate Totals
  44. $total_data = array();
  45. $total = 0;
  46. $taxes = $this->cart->getTaxes();
  47.  
  48. if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
  49. $this->load->model('setting/extension');
  50.  
  51. $sort_order = array();
  52.  
  53. $results = $this->model_setting_extension->getExtensions('total');
  54.  
  55. foreach ($results as $key => $value) {
  56. $sort_order[$key] = $this->config->get($value['code'] . '_sort_order');
  57. }
  58.  
  59. array_multisort($sort_order, SORT_ASC, $results);
  60.  
  61. foreach ($results as $result) {
  62. if ($this->config->get($result['code'] . '_status')) {
  63. $this->load->model('total/' . $result['code']);
  64.  
  65. $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes);
  66. }
  67. }
  68. }
  69.  
  70. $this->data['text_home'] = $this->language->get('text_home');
  71. $this->data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), (isset($this->session->data['wishlist']) ? count($this->session->data['wishlist']) : 0));
  72. $this->data['text_cart'] = $this->language->get('text_cart');
  73. $this->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));
  74. $this->data['text_search'] = $this->language->get('text_search');
  75. $this->data['text_welcome'] = sprintf($this->language->get('text_welcome'), $this->url->link('account/login', '', 'SSL'), $this->url->link('account/register', '', 'SSL'));
  76. $this->data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', 'SSL'), $this->customer->getFirstName(), $this->url->link('account/logout', '', 'SSL'));
  77. $this->data['text_account'] = $this->language->get('text_account');
  78. $this->data['text_checkout'] = $this->language->get('text_checkout');
  79. $this->data['text_language'] = $this->language->get('text_language');
  80. $this->data['text_currency'] = $this->language->get('text_currency');
  81.  
  82. $this->data['home'] = $this->url->link('common/home');
  83. $this->data['wishlist'] = $this->url->link('account/wishlist');
  84. $this->data['logged'] = $this->customer->isLogged();
  85. $this->data['account'] = $this->url->link('account/account', '', 'SSL');
  86. $this->data['cart'] = $this->url->link('checkout/cart');
  87. $this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');
  88.  
  89. if (isset($this->request->get['filter_name'])) {
  90. $this->data['filter_name'] = $this->request->get['filter_name'];
  91. } else {
  92. $this->data['filter_name'] = '';
  93. }
  94.  
  95. $this->data['action'] = $this->url->link('common/home');
  96.  
  97. if (!isset($this->request->get['route'])) {
  98. $this->data['redirect'] = $this->url->link('common/home');
  99. } else {
  100. $data = $this->request->get;
  101.  
  102. unset($data['_route_']);
  103.  
  104. $route = $data['route'];
  105.  
  106. unset($data['route']);
  107.  
  108. $url = '';
  109.  
  110. if ($data) {
  111. $url = '&' . urldecode(http_build_query($data));
  112. }
  113.  
  114. $this->data['redirect'] = $this->url->link($route, $url);
  115. }
  116.  
  117. if (($this->request->server['REQUEST_METHOD'] == 'POST') && isset($this->request->post['language_code'])) {
  118. $this->session->data['language'] = $this->request->post['language_code'];
  119.  
  120. if (isset($this->request->post['redirect'])) {
  121. $this->redirect($this->request->post['redirect']);
  122. } else {
  123. $this->redirect($this->url->link('common/home'));
  124. }
  125. }
  126.  
  127. $this->data['language_code'] = $this->session->data['language'];
  128.  
  129. $this->load->model('localisation/language');
  130.  
  131. $this->data['languages'] = array();
  132.  
  133. $results = $this->model_localisation_language->getLanguages();
  134.  
  135. foreach ($results as $result) {
  136. if ($result['status']) {
  137. $this->data['languages'][] = array(
  138. 'name' => $result['name'],
  139. 'code' => $result['code'],
  140. 'image' => $result['image']
  141. );
  142. }
  143. }
  144.  
  145. if (($this->request->server['REQUEST_METHOD'] == 'POST') && isset($this->request->post['currency_code'])) {
  146. $this->currency->set($this->request->post['currency_code']);
  147.  
  148. unset($this->session->data['shipping_methods']);
  149. unset($this->session->data['shipping_method']);
  150.  
  151. if (isset($this->request->post['redirect'])) {
  152. $this->redirect($this->request->post['redirect']);
  153. } else {
  154. $this->redirect($this->url->link('common/home'));
  155. }
  156. }
  157.  
  158. $this->data['currency_code'] = $this->currency->getCode();
  159.  
  160. $this->load->model('localisation/currency');
  161.  
  162. $this->data['currencies'] = array();
  163.  
  164. $results = $this->model_localisation_currency->getCurrencies();
  165.  
  166. foreach ($results as $result) {
  167. if ($result['status']) {
  168. $this->data['currencies'][] = array(
  169. 'title' => $result['title'],
  170. 'code' => $result['code'],
  171. 'symbol_left' => $result['symbol_left'],
  172. 'symbol_right' => $result['symbol_right']
  173. );
  174. }
  175. }
  176.  
  177. // Menu
  178. $this->load->model('catalog/category');
  179. $this->load->model('catalog/product');
  180.  
  181. $this->data['categories'] = array();
  182.  
  183. $categories = $this->model_catalog_category->getCategories(0);
  184.  
  185. foreach ($categories as $category) {
  186. if ($category['top']) {
  187. $children_data = array();
  188.  
  189. $children = $this->model_catalog_category->getCategories($category['category_id']);
  190.  
  191. foreach ($children as $child) {
  192. $data = array(
  193. 'filter_category_id' => $child['category_id'],
  194. 'filter_sub_category' => true
  195. );
  196.  
  197. $product_total = $this->model_catalog_product->getTotalProducts($data);
  198.  
  199. $children_data[] = array(
  200. 'name' => $child['name'] . ' (' . $product_total . ')',
  201. 'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
  202. );
  203. }
  204.  
  205. // Level 1
  206. $this->data['categories'][] = array(
  207. 'name' => $category['name'],
  208. 'children' => $children_data,
  209. 'column' => $category['column'] ? $category['column'] : 1,
  210. 'href' => $this->url->link('product/category', 'path=' . $category['category_id'])
  211. );
  212. }
  213. }
  214.  
  215. if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) {
  216. $this->template = $this->config->get('config_template') . '/template/common/header.tpl';
  217. } else {
  218. $this->template = 'default/template/common/header.tpl';
  219. }
  220.  
  221. $this->render();
  222. }
  223. }
  224. ?>

Z tego co zrozumiałem to za komentarzem menu jest tego kod, jest level1, a ja bym jeszcze chciał level 2 i może 3. Jeśli potrzebny kod czegoś jeszcze to proszę pisać, bo nie wiem, czy to wystarczy czy np.: header.tpl nie będzie potrzebny
Z góry dziękuję za pomoc:)