2017-06-09 14 views
0

バックエンドモジュールの通知を表示したい。私はこの主題の文書を見つけることができません。Prestashop 1.7:モジュール通知を表示

[通知]を[モジュール]> [通知]に表示したいとします。 「このモジュールを使用するには、お客様の顧客名を入力する必要があります。

ありがとうございます!

答えて

0

解決策はps_wirepaymentモジュールで見つかりました。私たちは、使用する必要があります。

$this->warning = $this->trans('Account owner and account details must be configured before using this module.', array(), 'Modules.Wirepayment.Admin'); 

例:

public function __construct() 
{ 
    $this->name = 'ps_wirepayment'; 

    ... 

    parent::__construct(); 

    ... 

    $config = Configuration::getMultiple(array('BANK_WIRE_DETAILS', 'BANK_WIRE_OWNER', 'BANK_WIRE_ADDRESS', 'BANK_WIRE_RESERVATION_DAYS')); 

    if (!empty($config['BANK_WIRE_OWNER'])) { 
     $this->owner = $config['BANK_WIRE_OWNER']; 
    } 
    if (!empty($config['BANK_WIRE_DETAILS'])) { 
     $this->details = $config['BANK_WIRE_DETAILS']; 
    } 
    if (!empty($config['BANK_WIRE_ADDRESS'])) { 
     $this->address = $config['BANK_WIRE_ADDRESS']; 
    } 
    if (!empty($config['BANK_WIRE_RESERVATION_DAYS'])) { 
     $this->reservation_days = $config['BANK_WIRE_RESERVATION_DAYS']; 
    } 


    if (!isset($this->owner) || !isset($this->details) || !isset($this->address)) { 
     $this->warning = $this->trans('Account owner and account details must be configured before using this module.', array(), 'Modules.Wirepayment.Admin'); 
    } 
    if (!count(Currency::checkPaymentCurrencies($this->id))) { 
     $this->warning = $this->trans('No currency has been set for this module.', array(), 'Modules.Wirepayment.Admin'); 
    } 
} 
関連する問題