2014-02-07 2 views
0

opencart 프론트 엔드에서 작업 중이며 모든 공급 업체에 대해 하위 도메인 유형의 구조를 만들었습니다. URL에 공급 업체 이름이 있으면 다른 하위 도메인으로 작동합니다.opencart에서 페이지를 찾을 수 없습니다.

입력 한 공급 업체 이름이 데이터베이스에없는 경우 페이지를 찾을 수 없습니다 페이지로 리디렉션하고 싶습니다. 그 정보를 가져올 수 있지만 index.php 페이지 또는 home.php 또는 그 밖의 다른 곳에서는 날씨를 확인할 곳이 없습니다.

내 URL은 localhost/user/vendor_name입니다.

어디에서 내가 not_found 페이지로 리디렉션 할 수 있는지 알려주세요. 공급 업체 파일의 프론트 엔드 컨트롤러 파일에서

+0

공급 업체 기능이 구현 되었습니까? 또는 당신은 약간 연장을 했습니까? –

+0

admin 용 멀티 벤더 확장 기능을 사용했지만 프론트 엔드 용으로 확장 기능을 사용하지 않았습니다. – saurabh

답변

0

는 같은 조건을 추가 :

if(vendor available){ 
//Show the correct contents 
    }else{ 

     $url = ''; 

     if (isset($this->request->get['path'])) { 
      $url .= '&path=' . $this->request->get['path']; 
     } 

     if (isset($this->request->get['filter'])) { 
      $url .= '&filter=' . $this->request->get['filter']; 
     } 

     if (isset($this->request->get['sort'])) { 
      $url .= '&sort=' . $this->request->get['sort']; 
     } 

     if (isset($this->request->get['order'])) { 
      $url .= '&order=' . $this->request->get['order']; 
     } 

     if (isset($this->request->get['page'])) { 
      $url .= '&page=' . $this->request->get['page']; 
     } 

     if (isset($this->request->get['limit'])) { 
      $url .= '&limit=' . $this->request->get['limit']; 
     } 

     $this->data['breadcrumbs'][] = array(
      'text'  => $this->language->get('text_error'), 
      'href'  => $this->url->link('vendor/vendor', $url), //replace with vendor controllers 
      'separator' => $this->language->get('text_separator') 
     ); 

     $this->document->setTitle($this->language->get('text_error')); 

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

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

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

     $this->data['continue'] = $this->url->link('common/home'); 

     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { 
      $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl'; 
     } else { 
      $this->template = 'default/template/error/not_found.tpl'; 
     } 

     $this->children = array(
      'common/column_left', 
      'common/column_right', 
      'common/content_top', 
      'common/content_bottom', 
      'common/footer', 
      'common/header' 
     ); 

     $this->response->setOutput($this->render()); 


} 

이 좋은 하루 되세요!

+0

이 페이지는 액세스되는 첫 페이지이기 때문에이 condtion을 home.php에 추가합니다. 그러나 그것은 column_right, column_left 및 column_top을 사용하며 이러한 레이아웃의 데이터가 변경되어 많은 수의 오류가 발생하는 조건이 있습니다. 제안 사항을 알려주십시오. – saurabh

+0

공급 업체 파일이나 집에서 변경 한 사항에 대해서는 잘 모릅니다. 또한 나는 위의 코드가 가정용 컨트롤러가 아니라고 강력히 믿는다. 공급 업체가 존재하는지 여부를 확인할 위치에 배치해야합니다. –

관련 문제