2017-04-18 1 views
0

저는 Prestashop에 새로 왔으며 고객 등록 후 부트 스트랩 경고 (성공 또는 위험)와 같은 알림을 표시하려고합니다. 나는 많은 해결책을 시도했지만 헛된. 예를 들어 코드의 그 라인이 작동하지 않습니다Prestashop : 화면에 알림 표시

$this->displayWarning($this->l('test')); 
$this->errors[] = Tools::displayError('test'); 
$this->displayInformation('test'); 

도움주세요!

+0

등 경고, 정보에 대한 프로세스에서

당신의 identity.tpl 삽입에 그런
$this->context->smarty->assign('confirmations', 'Confirm text'); 

? – NewUser

+0

이 코드를 모듈 기본 클래스 내에서 사용합니다. 실제로 모듈에서 작업합니다. –

+0

그러면 오른쪽 훅을 호출해야합니다. 사용자 등록 후 실행되는 고리를 호출하십시오. – NewUser

답변

0

$this->context->controller->errors[] = 'test';을 사용하면 오류가 표시됩니다.

다른 유형 (info, warning)의 경우 모듈을 smarty에 수동으로 할당해야합니다. 상단

{if isset($confirmations)} 
    <div class="alert alert-success"> 
     {$confirmations|escape:'htmlall':'utf-8'} 
    </div> 
{/if} 

반복이 코드를 사용하는