2014-07-07 3 views
0

이것은 까다로운 문제입니다.opencart 헤더 메뉴에 사용자 정의 메뉴 추가하기

나는 열려있는 장바구니 메뉴에서 가정용 버튼을 원했던 클라이언트/친구가 있는데, 나는 해결할 수있었습니다. 그러나 그는 5 가지 항목을 담고있는 조언을위한 드롭 다운 메뉴를 원합니다. 이 5 개 항목 자주 묻는 질문의, 저희에게 연락, 배송 정보, 개인 정보 보호 정책반환 정책 있습니다.

곧은 앞으로 그러나 페이지는 정보 페이지입니다.

내가하고 싶은 것은이 페이지에 링크하는 것입니다.

어드바이스의 ID는 80

  foreach ($children as $child) { 
       if ($child['category_id'] == 80) { 
        $children_data[] = array(
         'name' => $this->data['text_advicefaq'] = $this->language->get('text_advicefaq'), 
         'href' => $this->url->link('information/information', 'information_id=13') 
        ); 
       } 

       $data = array(
        'filter_category_id' => $child['category_id'], 
        'filter_sub_category' => true 
       ); 

       $product_total = $this->model_catalog_product->getTotalProducts($data); 

       $children_data[] = array(
        'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''), 
        'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) 
       );  
      } 

답변

4

1 단계

파일 열기 catalog/view/theme/<your theme>/template/common/header.tpl 같은 시도이다.

메뉴 코드를 찾으십시오.

 <li><a><?php echo $text_information; ?></a> 
     <div> 
      <ul> 
      <?php foreach ($informations as $information) { ?> 
      <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li> 
      <?php } ?> 
      <li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li> 
      </ul> 
     </div> 
     </li> 


2 단계

파일 열기 catalog/controller/common/header.php :

</ul> 전에 태그를 추가합니다.

찾기 :

$this->data['text_checkout'] = $this->language->get('text_checkout'); 

추가 후 : 같은 파일에서

$this->data['text_information'] = $this->language->get('text_information'); 
$this->data['text_contact'] = $this->language->get('text_contact'); 


3 단계

찾기 :

$this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL'); 

이 후 추가

$this->load->model('catalog/information'); 
    $this->data['informations'] = array(); 
    foreach ($this->model_catalog_information->getInformations() as $result) { 
     if ($result['bottom']) { 
      $this->data['informations'][] = array(
       'title' => $result['title'], 
       'href' => $this->url->link('information/information', 'information_id=' . $result['information_id']) 
      ); 
     } 
    } 
    $this->data['contact'] = $this->url->link('information/contact'); 

&는 다음을 확인합니다.

+0

고맙습니다. 작동합니다. – user3569147

관련 문제